V8 does inline functions at call sites where target is observed to be always the same. Inclined body is guarded by an identity check against identity of the call target. If guard fails code is deoptimized.
Thus what matters is whether each call site is monomorphic ( sees the same function all the time) or megamorphic (sees different functions).
Without seeing complete code it is hard to say whether you will help inlining by creating a single empty function (inlining definitely will not happen if you create new functions and send them to a single call site again and again). But you will definitely save space.
--
Vyacheslav Egorov
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
Well if you create a single global function you will at least save memory and allocation time (as function literal creates a new function every time it is executed).
Additionally if you always pass empty function to async_http_get then its better to create a single function to help inlining as explained in my previous mail.
Anyway all this matters only on a very hot path.
Vyacheslav Egorov