will-it-optimize

0.1.1 • Public • Published

will-it-optimize

Current Version

I don't care if something will blend (well, I kind of do). I want to know if something can be optimized by v8. will-it-optimize reports whether or not a function can be optimized based on its contents. Hopefully, this will make it easier to track what can be optimized in various versions of node.js without paying extremely close attention to the v8 codebase.

Running the Tests

npm start

Test Structure

A test is defined by the module.exports object. The following properties are supported:

  • description - String. A written description of the test. Markdown is allowed.
  • exec - Function. The test code to execute.
  • args - Optional Array. Arguments passed to the test code.
  • warmup - Optional Array. Array of objects used to warmup v8. If warmup is not specified, the test function will be invoked once using args as the arguments. Each object in the array results in an invocation of the test function. This is used to fill in v8's type info. Each object may contain the following fields:
    • args - Optional Array. Arguments passed to the test code on the given warmup iteration.

An example test is shown below. This will execute a function containing a with statement, which v8 cannot currently optimize.

module.exports = {
  description: '`with` statement',
  exec: function exec() {
    with ({}) {}
  }
};

Required Reading

Readme

Keywords

none

Package Sidebar

Install

npm i will-it-optimize

Weekly Downloads

1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • cjihrig