No, it is definitely possible. It requires a simple analysis at the parser level and minor changes in Crankshaft pipeline.
-- Vyacheslav Egorov On Fri, Apr 13, 2012 at 4:45 PM, Bert Belder <[email protected]> wrote: > On Apr 13, 2:48 pm, Vyacheslav Egorov <[email protected]> wrote: > > fib in "Node's main JS thread" case is a "local" function declaration, V8 > > compiles recursive call as > s faster) than call-function which uses separate > > generic stub: > > > > ;;; @40: call-known-global. > > 0x3c5d7c2c30d 109 48bff96d452dc6150000 REX.W movq rdi,0x15c62d456df9 > > ;; object: 0x15c62d456df9 <JS Function fib> > > 0x3c5d7c2c317 119 4c89e1 REX.W movq rcx,r12 > > 0x3c5d7c2c31a 122 e881ffffff call 0 (0x3c5d7c2c2a0) ;; debug: > > position 41 > > ;; code: > > OPTIMIZED_FUNCTION > > > > vs. > > > > ;;; @52: call-function. > > 0x1e5a9c3a52fd 125 e85e46f6ff call 0x1e5a9c309960 ;; debug: > > position 139 > > ;; code: > STUB, > > CallFunctionStub, argc = 1 > > > > [call function stub is a complicated generic stub that can handle all > kinds > > of calls] > > > > -- > > Vyacheslav Egorov > > > > > > > > > > > > > > > > On Thu, Apr 12, 2012 at 7:29 PM, mscdex <[email protected]> wrote: > > > On Apr 12, 9:54 am, Tim Caswell <[email protected]> wrote: > > > > What makes the main thread so slow in comparison? It's the same v8 > > > right? > > > > > Here's something more interesting: > > > > >https://gist.github.com/2369318 > > > > > Threads_a_gogo JS thread -> 3039 (ms) 298607040 > > > Node's main JS thread -> 4677 (ms) 298607040 > > > Ratio: 1.54 times faster than main JS thread > > > New, separate VM -> 3065 (ms) 298607040 > > > Ratio: 1.01 times faster than new VM > > > > > -- > > > 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 > > Thanks for your analysis, Vyacheslav. > > So what can we do about it? It seems that in node all functions will > be "local" functions because of the module system. Is it not possible > to have an efficient stub for these guys? > > - Bert > > -- > 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 > -- 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
