question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Native array is faster than this[]

See original GitHub issue

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® Core™ i7-4870HQ CPU @ 2.50GHz × 8

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Salakarcommented, Nov 21, 2016

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

You’re more than welcome to do one however

0reactions
calebboydcommented, Nov 20, 2016

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is NativeArray slower than regular array? (2018.1.0b6)
This shows that single-threaded calculations with regular arrays are about 2.3x faster than the same calculations using NativeArray.
Read more >
Java Buffer types versus native arrays: which is faster?
However, they are not as fast as native arrays in my experience. ... That is, arrays are over 4 times faster than IntBuffers...
Read more >
Comparing the performance difference between Struct-As ...
When using a NativeArray, the allocation is more costly than when allocating a struct on the stack, so my hypothesis is that SAAs...
Read more >
NativeArray<T> is slower than built-in C# array - Issue Tracker
NativeArray in mono in the editor is slower than builtin arrays * We need to make sure agressive inline works properly, if not...
Read more >
Why are native array functions are so much slower then loop
So why are native functions are so much slower then old loops and what was the point of creating them if they are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found