Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf_hooks: implementation of Performance Timing API #14680

Closed
wants to merge 1 commit into from

Commits on Aug 23, 2017

  1. perf_hooks: implementation of the perf timing API

    An initial implementation of the Performance Timing API for Node.js.
    This is the same Performance Timing API implemented by modern browsers
    with a number of Node.js specific properties. The User Timing mark()
    and measure() APIs are implemented, garbage collection timing, and
    node startup milestone timing.
    
    ```js
    const { performance } = require('perf_hooks');
    
    performance.mark('A');
    setTimeout(() => {
      performance.mark('B');
      performance.measure('A to B', 'A', 'B');
      const entry = performance.getEntriesByName('A to B', 'measure')[0];
      console.log(entry.duration);
    }, 10000);
    ```
    
    The implementation is at the native layer and makes use of uv_hrtime().
    This should enable *eventual* integration with things like Tracing
    and Inspection.
    
    The implementation is extensible and should allow us to add new
    performance entry types as we go (e.g. for measuring i/o perf,
    etc).
    
    Documentation and a test are provided.
    jasnell committed Aug 23, 2017
    Configuration menu
    Copy the full SHA
    0472f94 View commit details
    Browse the repository at this point in the history