Why can't V8 deduce that the order of keys doesn't matter? It's pretty nuts that just rearranging the keys from { x, y, z } to { y, x, z } would cause a slowdown.
You can't deduce that; you'd need to show that the object is never passed to for..in or Object.keys or similar to be able to avoid storing the insertion order. They could change the representation to not be insertion order dependent, and store insertion order in a separate data structure, but that has its own trade-offs.
Why the New V8 Is So Damn Fast
21–30 of 237 posts
Re: Why the New V8 Is So Damn Fast
#22Earlier quoted context omitted.
Just use Express.js or Sails.js, they're 1:1 to Sinatra or Rails. Join us!
How is Express even remotely close to Rails? Express is a glorified router.
Re: Why the New V8 Is So Damn Fast
#23As an internet user, I really enjoy reading about all these performance improvements in V8 / javascript. As a ruby developer, I'm insanely jealous.
I would insanely choose ruby rather than javascript for the major advantages that has to offer. Performance in most of cases is not a real needed over consistency. Also Ruby 2.6 has jit, would be great to see some bench tests. :P
There’s definitely room for improvement, and the inclusion of JIT infrastructure is awesome, it’s just not making much of a performance impact. Yet.
Re: Why the New V8 Is So Damn Fast
#24Earlier quoted context omitted.
Just use Express.js or Sails.js, they're 1:1 to Sinatra or Rails. Join us!
How is Express even remotely close to Rails? Express is a glorified router.
To which I agree with the Express / Sinatra similarity.
Re: Why the New V8 Is So Damn Fast
#25Re: Why the New V8 Is So Damn Fast
#26Re: Why the New V8 Is So Damn Fast
#27saved you a click.
Re: Why the New V8 Is So Damn Fast
#28As an internet user, I really enjoy reading about all these performance improvements in V8 / javascript. As a ruby developer, I'm insanely jealous.
I would insanely choose ruby rather than javascript for the major advantages that has to offer. Performance in most of cases is not a real needed over consistency. Also Ruby 2.6 has jit, would be great to see some bench tests. :P
Re: Why the New V8 Is So Damn Fast
#29I used to believe that javascript was slow, C was fast and that there was no way to change this because of the way that javascript is interpreted and not compiled. But the more I've learnt about the benefits of "on the fly" / "just in time" optimising compilers, the more I'm convinced this is the future of computing. Being able to use multiple threads and hence multiple cores simultaneously to optimise what is actual…
Welcome to 1995 and the wonderful world of Java. Except in Java you can use threads to use multiprocessing, so you can have efficient shared data structures but also hard to debug bugs.
Re: Why the New V8 Is So Damn Fast
#30Earlier quoted context omitted.
You can't deduce that; you'd need to show that the object is never passed to for..in or Object.keys or similar to be able to avoid storing the insertion order. They could change the representation to not be insertion order dependent, and store insertion order in a separate data structure, but that has its own trade-offs.
Does for..in actually require that keys be returned in a specific order? Most languages specifically call out that the order is not guaranteed (not that that stops developers from relying on an order)
The "new" generation of JS VMs (V8, Chakra, Carakan) all dropped insertion order for array index properties (that is properties whose name is a uint32), but kept it for everything else; that broke about as much as browsers are willing to break, and breaking the general case would be far, far worse.