Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

оптимизировать код for i, value in ipairs(data.values) do -> for i = 1, #data.values do #1

Open
mmmcorpsvit opened this issue Sep 9, 2017 · 0 comments

Comments

@mmmcorpsvit
Copy link
Owner

mmmcorpsvit commented Sep 9, 2017

согласно https://ilovelua.wordpress.com/tag/%D0%BE%D0%BF%D1%82%D0%B8%D0%BC%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D1%8F/
есть такая оптимизация, тестируем предположение в игре, файл mmm_test.script:
результаты:
`
~ run_script mmm_test

~~~ipairs end:312425.21875
~~~# end:186259.390625
~~~ipairs end:313439.625
~~~# end:185345.65625
~~~ipairs end:311206.625
~~~# end:185610.265625
~~~ipairs end:312442.78125
~~~# end:186171.234375
~~~ipairs end:312739.5
~~~# end:186604.203125
~~~ipairs end:311460.875
~~~# end:186051.4375
~~~ipairs end:312272.875
~~~# end:186301.71875
~~~ipairs end:311259.59375
~~~# end:186827.65625
~~~ipairs end:309881.875
~~~# end:185874.828125
~~~ipairs end:312488.71875
`

средний прирост 58%

оптимизируем все скрипты
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant