joyent/node — pull request #4686 by isaacs (2013-01-30 07:31:22+00:00)
Title: node: Do not use fn.apply() in process._makeCallback

This might be kind of silly, I'm not sure.

@trevnorris reported seeing a lot of deopt's of process._makeCallback. Since I'd expect that to be pretty hot code, I tried nudging things around so that it's not using function.apply(), and instead just passing the method name as a string, and calling `obj[fn](...)`. Also, if there's 3 or fewer args, it just calls it like a normal method, instead of using .apply. (This covers most instances of MakeCallback.)

It's getting late here, but if someone could review this, I'd be much obliged. I don't see any massive speedups in http_simple or net-pipe, but every little bit helps. (If it's actually not a benefit, I'm fine trashing it.)