summaryrefslogtreecommitdiff
path: root/src/node_perf_common.h
Commit message (Collapse)AuthorAgeFilesLines
* perf_hooks: make GC tracking state per-EnvironmentAnna Henningsen2019-02-281-0/+2
| | | | | | | | | | | Otherwise this is global state that may be subject to race conditions e.g. when running `perf_hooks` inside of Worker threads. Tracking the GC type is removed entirely since the variable was unused. PR-URL: https://github.com/nodejs/node/pull/25053 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* src: add missing `NODE_WANT_INTERNALS` guardsAnna Henningsen2018-09-061-0/+4
| | | | | | | | | | | | | We generally add these to all headers that are considered internal to Node. These aren’t distributed as part of the headers tarball, so I think this does not have to be semver-major (and we have been changing the APIs in these headers freely anyway). PR-URL: https://github.com/nodejs/node/pull/22514 Reviewed-By: James M Snell <jasnell@gmail.com>
* perf_hooks: remove less useful bootstrap marksJames M Snell2018-06-161-9/+2
| | | | | | | | | While `perf_hooks` is still in experimental, remove less useful bootstrap milestones. PR-URL: https://github.com/nodejs/node/pull/21247 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
* perf_hooks,trace_events: emit perf milestone trace eventsJames M Snell2018-03-161-6/+3
| | | | | | | Emit the perf_hooks node timing milestones as trace events. PR-URL: https://github.com/nodejs/node/pull/19175 Reviewed-By: Anna Henningsen <anna@addaleax.net>
* perf_hooks: fix timingTimothy Gu2018-03-061-1/+5
| | | | | | | | | | | | Fixes: https://github.com/nodejs/node/issues/17892 Fixes: https://github.com/nodejs/node/issues/17893 Fixes: https://github.com/nodejs/node/issues/18992 PR-URL: https://github.com/nodejs/node/pull/18993 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
* http2,perf_hooks: perf state using AliasedBufferKyle Farnung2018-01-241-4/+27
| | | | | | | | Update performance_state to use AliasedBuffer and update usage sites. PR-URL: https://github.com/nodejs/node/pull/18300 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
* http2: perf_hooks integrationJames M Snell2018-01-021-1/+2
| | | | | | | | | Collect and report basic timing information about `Http2Session` and `Http2Stream` instances. PR-URL: https://github.com/nodejs/node/pull/17906 Refs: https://github.com/nodejs/node/issues/17746 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* src: fix build on certain platformsAnna Henningsen2017-08-231-1/+2
| | | | | | | | | | | | | | | | The `double` fields in `performance_state` could previously have been aligned at 4-byte instead of 8-byte boundaries, which would have made creating an Float64Array them as a array buffer view for an ArrayBuffer extending over the entire struct an invalid operation. Ref: 67269fd7f33279699b1ae71225f3d738518c844c Comments out related flaky failure PR-URL: https://github.com/nodejs/node/pull/14996 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
* perf_hooks: implementation of the perf timing APIJames M Snell2017-08-231-0/+71
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. PR-URL: https://github.com/nodejs/node/pull/14680 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>