• I'm guessing that 0.5 seconds isn't just for one call? Is that total runtime (including everything else), or just the timings for the call on its own?

    It's hard to know exactly where the problem lies. You're sure that the agent function is being executed in both cases?

    The only thing I could think that could make the first line 30 times slower is if the function (or its prototype) had a huge amount of fields inside it. You could try:

    agent[message.content.method].foo;agent[message.content.method](message.content.params,callback);
    

    And see if that slows it down at all...

About

Avatar for Gordon @Gordon started