I see 2 issues here: 1) optimiz-ability of the code generated by eval. 2) the fact that you have to eval every time if the async function is inside a closure.
I don't know how real 1) is but 2) is problematic if you use lots of closures. Streamline does not have this problem because it transforms at require time (or compile time, your choice) and it does not generate any "eval" nor "new Function" calls when it transforms the code. On Thursday, August 23, 2012 10:14:11 PM UTC+2, Andy wrote: > > yeah, google groups can get a bit annoying at times > > Regarding *eval*, I'm pretty wary of running your entire async code > through it as a string. During this talk on v8 > internals<http://blip.tv/jsconf/jsconf2012-vyacheslav-egorov-6141593> at > JSConf US, this Russian v8 developer with a long name talks about how v8 > runs and optimizes your code. Unfortunately it's not in the video, but > during the Q&A section I asked him if v8 could perform the same > optimizations for code instantiated with *new Function()*. He said *yes, > but it could not optimize eval*. I think it had something to do with the > ambiguity of the scope eval executes in. > > I know this is a vague answer, and I hope I'm not misquoting him. I'd like > to see some benchmarks of your compiled code vs the original. And it > probably wouldn't be that big of a change to compile it to a capital F * > Function* instead, for which a benchmark would also be useful. > -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
