-
Notifications
You must be signed in to change notification settings - Fork 320
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
cached this.content and this.socreFunction ( faster 7.5%), and have s… #50
base: master
Are you sure you want to change the base?
Conversation
…wap default value of bubbleUp an int (faster 80%)
I've found that using this version as a drop in replacement does not work properly. It provides suboptimal paths. I'll poke through at some point to see what optimizations work or not here, but for now I would recommend against including these changes. |
My Bad !!!
( sorry, not fluent enough with git to push the change.... ) |
@gamealchemist: you just need to update the code on your branch and this pull request will automatically update with your new commit. |
You can also just accept the pull request I made against your branch |
Corrected bug caused by improper swap testing
Thanks for the pool. Is it working now ? ( Faster ? ) |
It works now, but I didn't benchmark it so I can't say one way or another about performance. |
There are a lot of unrelated changes in this PR that make it hard for me to review and follow.
Is it possible to have a simpler commit that just does that change? I can't tell what the size/scope of that change is in the diff. |
Well, all other changes are about caching ( |
@gamealchemist - just break it up into smaller pull requests. One that does the in function 'caching' and another that uses -1 instead of null. |
Again : other changes are just about caching. Any bug would show at once (the cache vars would be undefined -->> an exception thrown ). |
I'm not really interested in taking any of the caching changes / 'other small things' unless if we can properly benchmark it across engines and it makes a significant improvement. More to the point, it makes it harder to follow exactly what the swap change is doing. Those two things should at least be broken into separate commits since they are separate logical chunks of work. |
I optimized the Binary Heap in a few ways :
• cached the properties that were used several times, content and scoreFunction ( 7.5% faster).
• cached scoreElement in sinkDown ( a bit better ).
• A few others small things.
• BUT most improvement (80% !!! ) came from using -1 and not null as the default value for swap.
The benchmark went from near 2ms
• to near 1.8 ms with the first changes,
• then to near 1.0 ms with the swap = -1 thing.