Comment #1 on issue 2179 by [email protected]: Breakpoint of not executed
function slows down javascript performance
http://code.google.com/p/v8/issues/detail?id=2179
var BreakPointPerformance = function() {
}
BreakPointPerformance.prototype.breakFunc = function() {
return 0;
}
BreakPointPerformance.prototype.mathFunc = function() {
var a = Math.sqrt(Math.random());
return a;
}
BreakPointPerformance.prototype.runLoop = function() {
console.time("loop time");
var b = 0;
for(var i=0;i<10000000;i++) {
b+=this.mathFunc();
}
console.timeEnd("loop time");
}
var p = new BreakPointPerformance();
p.runLoop();
Running above code in Chrome takes around 100ms on my machine.
If i set a breakpoint at the return statement of breakFunc, which is
not executed at all, i get around 19000ms.
How come the breakpoint of the not executed function affects overall
execution speed?
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev