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

Native array is faster than this[] #5

Open
yzarubin opened this issue Jan 14, 2016 · 5 comments
Open

Native array is faster than this[] #5

yzarubin opened this issue Jan 14, 2016 · 5 comments

Comments

@yzarubin
Copy link

I'm getting significantly faster performance using a native array this.arr = []; and replacing all instances of this[] with this.arr[] . Running the two_million benchmark, I'm getting ~23 milllion ops/s with this[] vs 25-26 million ops/s using this.arr[]

Thoughts?

Darwin 13.4.0 x64
Node.JS 4.1.2
V8 4.5.103.35
Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz × 8

@yzarubin yzarubin changed the title Native array is faster Native array is faster than this[] Jan 14, 2016
@Salakar
Copy link

Salakar commented Jul 2, 2016

@yzarubin there's this and quite a few other things that can be done for perf on deque.

But, with the lack of maintenance on this repo I ended up rolling my own double-ended queue which well out performs this. 🙈

image

@petkaantonov
Copy link
Owner

PRs welcome of course :) it has been 2-3 years so it's expected some things have been changed in v8 :P

@Salakar
Copy link

Salakar commented Jul 2, 2016

@petkaantonov I considered PR'ing this, but I didn't know where to start as it was different implementation and was concerned the PR would sit there and go mouldy 😄

Was helpful though seeing how you initially approached things, always looking through your source code like the stalker that I am. 🌝

@calebboyd
Copy link

@Salakar you should submit a PR so all the dependents can benefit :)

@Salakar
Copy link

Salakar commented Nov 21, 2016

@calebboyd I didn't want to be 'that guy' =]

You're more than welcome to do one however

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

No branches or pull requests

4 participants