[v8-users] Most efficient way to work with arrays.

2014-12-17 Thread Arthur Shefer
Heya, I'm developing a small compiler for JavaScript and wondering if someone could point out which is the most efficient way to handle array memory in V8. Currently, if array needs regular push/pops I will manually extend length and store numElements in additional variable (some what similar

Re: [v8-users] Most efficient way to work with arrays.

2014-12-17 Thread Jakob Kummerow
The internal heuristics are complicated, but the short story is that both array.push(x) and array[array.length] = x should be very fast. What you're doing seems unnecessary and potentially even bad for performance (if it happens to defeat internal optimizations). Then again without measuring,