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

Don't mutate pointer array. Performance speedup. #22

Merged
merged 1 commit into from
Mar 18, 2016
Merged

Don't mutate pointer array. Performance speedup. #22

merged 1 commit into from
Mar 18, 2016

Conversation

IvanGoncharov
Copy link
Contributor

Without this change every function modify the value of pointer array.
Didn't expect such behaviour so spend ~20 min figuring what happing.

As a nice bonus, it provides a significant speedup.
Since shift is ~10x slower than for(...), see:
http://jsperf.com/array-reverse-pop-versus-shift/2

@IvanGoncharov
Copy link
Contributor Author

@manuelstofer Please review it.
It blocks my project.

@manuelstofer
Copy link
Owner

Thanks! Looks good!

manuelstofer added a commit that referenced this pull request Mar 18, 2016
Don't mutate pointer array. Performance speedup.
@manuelstofer manuelstofer merged commit 495e372 into manuelstofer:master Mar 18, 2016
@IvanGoncharov
Copy link
Contributor Author

@manuelstofer Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants