Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Possible try/catch optimizations in the runtime #148

@maxnordlund

Description

@maxnordlund

I was reading through the runtime today and noticed the use of try/catch in runtime.async and invoke on two places. This will lead to deoptimizations and as they are core prices of functionality they are crucial for good performance. This can be fairly easily be avoided and I see two primary ways of doing the, either add a helper function like this:

var _try = function _try(block, catcher) {
  try {
    block()
  } catch (err) {
    catcher(err)
  }
}

Or break out the mentioned sections of code into their own function to lessen the effect. I suggest the first, but it might be good to break out some of the code from invoke since it is currently ~110 lines long. What do you think about this? Which way do you think is best?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions