gf3 / sandbox

A nifty JavaScript sandbox for Node.js
ISC License
844 stars 123 forks source link

the speed is too slow #42

Open kaisatec opened 9 years ago

kaisatec commented 9 years ago

my code

var a=0; var j=10000; for (var i=0; i<=j;i++){
a=a+i_i_30+i/2+i/2; }

for eval(js)

1 ms

for sandbox

188ms

is there a way to improve the speed?

Thanks

yorickvP commented 8 years ago

I suspect that this is a fixed delay caused by starting a new process etc. The actual execution should not be slower, but loading v8 and node adds some overhead. If you double the loop size, does the time double?