Closed TimvanScherpenzeel closed 5 years ago
The big note at the top of that document has what's likely a better answer than I can give: eval() isn't an instant performance bailout, and the way it's being used here would mostly impact initial execution. AFAIK it would not prevent hot code from being JIT'ed.
Hi,
Thank you for this polyfill / proposal.
I was wondering about the use of
eval()
in web workers. As you probably know any code ran througheval
is very unlikely to be optimised by V8 (see https://github.com/petkaantonov/bluebird/wiki/Optimization-killers). Would you know if this is also the case foreval
in web workers? If so, wouldn't it make sense to avoid heavy long running code in the worker (that normally would becomehot
in the main thread after a short time)? Doesn't that defeat the whole point of using a worker in the first place (seeing as there is a reasonably significant cost to spawning and thread hopping)? Making a worker worth its weight in that case would be a significant challenge.Kind regards,
Tim