The performance differs only with 50%, I expected more actually. Am I doing something wrong?
V8 Optimization Killers
31–40 of 88 posts
Re: V8 Optimization Killers
#32Title should probably be "V8 Optimization Killers".
I'm really sick of these recent JavaScript performance related posts that only talk about V8.
Re: V8 Optimization Killers
#33Really great! Some notes that popped out for me are that to always cache the .length property for any array or arguments: function doesntLeakArguments() { var args = new Array(arguments.length); for(var i = 0; i becomes: function doesntLeakArguments() { var len = arguments.length; var args = new Array(len); for(var i = 0; i And also, if you've got a switch statement with more than 128 cases, you've probably got bigge…
Huge switches are common in the inner loop of emulators and interpreters. They tend to end up with a 256-case switch to handle the next byte in the instruction stream.
Re: V8 Optimization Killers
#34Title should probably be "V8 Optimization Killers".
I'm really sick of these recent JavaScript performance related posts that only talk about V8.
Re: V8 Optimization Killers
#35Really great! Some notes that popped out for me are that to always cache the .length property for any array or arguments: function doesntLeakArguments() { var args = new Array(arguments.length); for(var i = 0; i becomes: function doesntLeakArguments() { var len = arguments.length; var args = new Array(len); for(var i = 0; i And also, if you've got a switch statement with more than 128 cases, you've probably got bigge…
Huge switches are common in the inner loop of emulators and interpreters. They tend to end up with a 256-case switch to handle the next byte in the instruction stream.
Re: V8 Optimization Killers
#36Title should probably be "V8 Optimization Killers".
I'm really sick of these recent JavaScript performance related posts that only talk about V8.
Maybe apart from games, most of this is irrelevant for browser side javascript.
Re: V8 Optimization Killers
#37Earlier quoted context omitted.
I'm really sick of these recent JavaScript performance related posts that only talk about V8.
It would be nice to see more information about optimizing for IE and Firefox's JS engines, but to be fair, V8 accounts for a large percent of browser JS and all of Node.js as well.
Re: V8 Optimization Killers
#38Really great! Some notes that popped out for me are that to always cache the .length property for any array or arguments: function doesntLeakArguments() { var args = new Array(arguments.length); for(var i = 0; i becomes: function doesntLeakArguments() { var len = arguments.length; var args = new Array(len); for(var i = 0; i And also, if you've got a switch statement with more than 128 cases, you've probably got bigge…
This used to be good advice, but I'm pretty sure that the modern engines all perform this optimization for you now.
Re: V8 Optimization Killers
#39Really great! Some notes that popped out for me are that to always cache the .length property for any array or arguments: function doesntLeakArguments() { var args = new Array(arguments.length); for(var i = 0; i becomes: function doesntLeakArguments() { var len = arguments.length; var args = new Array(len); for(var i = 0; i And also, if you've got a switch statement with more than 128 cases, you've probably got bigge…
This used to be good advice, but I'm pretty sure that the modern engines all perform this optimization for you now.
for(var i=0;i
Re: V8 Optimization Killers
#40Earlier quoted context omitted.
I'm really sick of these recent JavaScript performance related posts that only talk about V8.
Just a cursory glance at browser stats seems to show chrome as the most popular which would make sense. I highly doubt anyone using internet explorer is coming to SO.