-
Notifications
You must be signed in to change notification settings - Fork 465
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
Performance and Memory improvement for loops #985
Conversation
Adds Memory Manager to Environment. This way memory can be reclaimed once the Environment goes out of scope. So everything that only lives in a certain Environment, as variables do, should be allocated via that "allocator".
Ooh, pretty cool! It'll be interesting to see the impact on large scss projects. |
👍 |
Seeing ~0.8% speedup on project compile time vs 3.2.0-beta.2 |
@drewwells I'm actually quite surprised that you see such an improvement. My benchmark test was really not a real-wold case and I was more concerned with the memory usage there (DOS). I would also like to implement memory limits for allocations as it should be trivial inside memory manager. |
Yeah I thought 0.8% was really impressive. The performance graph does show On Thu, Mar 26, 2015 at 1:52 PM Marcel Greter [email protected]
|
Btw. related issue #613 |
I actually have another optimization pending in https://github.com/mgreter/libsass/tree/refactor/prelexer. With that branch, my spec runner reports a pretty nice improvement 😄 So stay tuned!
|
rock on 💯 ! |
Performance and Memory improvement for loops
Added some performance improvements for some loops. Currently libsass allocates a new variable in a
for
loop for each iteration. This is not the best strategy, as it costs us performance and memory (since all these allocations would not be freed until context is freed). I have added two different optimizations and we should try to find more spots which could optimize the same way.for
loop to re-use the same variable as iterator (maybe we should make sure that we reset the unit in case the user has changed it, since we only change the actual value ... can we even iterate over pixels?).Made some benchmarks with a very big for loop: