summaryrefslogtreecommitdiff
path: root/doc/api/perf_hooks.md
AgeCommit message (Collapse)Author
2019-02-142018-02-14, Version 11.10.0 (Current)Michaël Zasso
Notable changes: deps: * Updated libuv to 1.26.0. * Updated npm to 6.7.0. http, http2: * `response.writeHead` now returns the response object. perf_hooks: * Implemented a histogram based API. process: * Exposed `process.features.inspector`. repl: * Added `repl.setupHistory` for programmatic repl. tls: * Introduced client "session" event. PR-URL: https://github.com/nodejs/node/pull/26098
2019-02-12doc: fix some nits in perf_hooksVse Mozhet Byt
PR-URL: https://github.com/nodejs/node/pull/26022 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-08perf_hooks: implement histogram based apiJames M Snell
Add a sampling-based event loop delay monitor. ```js const { monitorEventLoopDelay } = require('perf_hooks'); const h = monitorEventLoopDelay(); h.enable(); h.disable(); console.log(h.percentiles); console.log(h.min); console.log(h.max); console.log(h.mean); console.log(h.stddev); console.log(h.percentile(50)); ``` PR-URL: https://github.com/nodejs/node/pull/25378 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-12-17doc,lib,test: capitalize comment sentencesRuben Bridgewater
This activates the eslint capitalize comment rule for comments above 50 characters. PR-URL: https://github.com/nodejs/node/pull/24996 Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-06-15perf_hooks: remove less useful bootstrap marksJames M Snell
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>
2018-04-29doc: remove redundant empty linesVse Mozhet Byt
PR-URL: https://github.com/nodejs/node/pull/20398 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-04-15doc: unify section structuresVse Mozhet Byt
PR-URL: https://github.com/nodejs/node/pull/20028 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-09doc: specify definite Array typesVse Mozhet Byt
Replace `{Array}` with `{type[]}`. PR-URL: https://github.com/nodejs/node/pull/19895 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-04-04doc,tools: formalize, unify, codify default valuesVse Mozhet Byt
PR-URL: https://github.com/nodejs/node/pull/19737 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-03perf_hooks: simplify perf_hooksJames M Snell
Remove the `performance.getEntries()` and `performance.clear*()` variants and eliminate the accumulation of the global timeline entries. The design of this particular bit of the API is a memory leak and performance footgun. The `PerformanceObserver` API is a better approach to consuming the data in a more transient way. PR-URL: https://github.com/nodejs/node/pull/19563 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-03-25doc: add `http2` to performanceEntry.entryTypeYuta Hiroto
add `http2` to performanceEntry.entryType in perf_hooks PR-URL: https://github.com/nodejs/node/pull/19584 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-03-06perf_hooks: fix timingTimothy Gu
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>
2018-02-26perf_hooks: emit trace events for marks, measures, and timerifyJames M Snell
Adds the `node.perf.usertiming` trace events category for recording usertiming marks and measures (e.g. `perf_hooks.performance.mark()`) in the trace events timeline. Adds the `node.perf.function` trace events category for recording `perf_hooks.performance.timerify()` durations in the trace events timeline. PR-URL: https://github.com/nodejs/node/pull/18789 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-02-222018-02-22, Version 9.6.0 (Current)Myles Borins
Notable changes: * async_hooks: - deprecate unsafe emit{Before,After} (Ali Ijaz Sheikh) https://github.com/nodejs/node/pull/18513 - rename PromiseWrap.parentId to PromiseWrap.isChainedPromise (Ali Ijaz Sheikh) https://github.com/nodejs/node/pull/18633 * deps: - update node-inspect to 1.11.3 (Jan Krems) https://github.com/nodejs/node/pull/18354 - ICU 60.2 bump (Steven R. Loomis) https://github.com/nodejs/node/pull/17687 - Introduce ScriptOrModule and HostDefinedOptions to V8 (Jan Krems) https://github.com/nodejs/node/pull/16889 * http: - add options to http.createServer() for `IncomingMessage` and `ServerReponse` (Peter Marton) https://github.com/nodejs/node/pull/15752 * http2: - add http fallback options to .createServer (Peter Marton) https://github.com/nodejs/node/pull/15752 * https: - Adds the remaining options from tls.createSecureContext() to the string generated by Agent#getName(). This allows https.request() to accept the options and generate unique sockets appropriately. (Jeff Principe) https://github.com/nodejs/node/pull/16402 * inspector: - --inspect-brk for es modules (Guy Bedford) https://github.com/nodejs/node/pull/18194 * lib: - allow process kill by signal number (Sam Roberts) https://github.com/nodejs/node/pull/16944 * module: - enable dynamic import (Myles Borins) https://github.com/nodejs/node/pull/18387 - dynamic import is now supported (Jan Krems) https://github.com/nodejs/node/pull/15713 * napi: - add methods to open/close callback scope (Michael Dawson) https://github.com/nodejs/node/pull/18089 * src: - allow --perf-(basic-)?prof in NODE_OPTIONS (Leko) https://github.com/nodejs/node/pull/17600 * vm: - add support for es modules (Gus Caplan) https://github.com/nodejs/node/pull/17560 PR-URL: https://github.com/nodejs/node/pull/18902
2018-01-312018-01-31, Version 9.5.0 (Current)Evan Lucas
Notable changes: * cluster - add cwd to cluster.settings (cjihrig) [#18399](https://github.com/nodejs/node/pull/18399) * deps - upgrade libuv to 1.19.1 (cjihrig) [#18260](https://github.com/nodejs/node/pull/18260) * meta - add Leko to collaborators (Leko) [#18117](https://github.com/nodejs/node/pull/18117) - add vdeturckheim as collaborator (vdeturckheim) [#18432](https://github.com/nodejs/node/pull/18432) * n-api - expose n-api version in process.versions (Michael Dawson) [#18067](https://github.com/nodejs/node/pull/18067) * perf_hooks - add performance.clear() (James M Snell) [#18046](https://github.com/nodejs/node/pull/18046) * stream - avoid writeAfterEnd() while ending (陈刚) [#18170](https://github.com/nodejs/node/pull/18170) PR-URL: https://github.com/nodejs/node/pull/18464
2018-01-31perf_hooks: add warning when too many entries in the timelineJames M Snell
PR-URL: https://github.com/nodejs/node/pull/18087 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-01-24doc: add doc for performance.clearGC()Antony Tran
PR-URL: https://github.com/nodejs/node/pull/18331 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2018-01-11perf_hooks,http2: add performance.clear()James M Snell
Add missing clear() method to `perf_hooks.performance` to remove the entries from the master timeline to prevent that from being a memory leak. PR-URL: https://github.com/nodejs/node/pull/18046 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-01-02doc: remove duplicate words in API docsTobias Nießen
PR-URL: https://github.com/nodejs/node/pull/17937 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2017-11-19doc: add missing introduced_in commentsLuigi Pinca
Add missing "introduced_in" comments for alternative version links. PR-URL: https://github.com/nodejs/node/pull/16741 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
2017-09-29perf_hooks: remove docs for unimplemented APISam Roberts
The node frame (aka loop) timing API did not land, it depends on https://github.com/libuv/libuv/pull/1489 which is still a WIP. See: https://github.com/nodejs/node/pull/14680#discussion_r140605664 PR-URL: https://github.com/nodejs/node/pull/15641 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-19doc: fix entryTypes type and missing linkMani Maghsoudlou
PR-URL: https://github.com/nodejs/node/pull/15406 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2017-09-122017-09-12, Version 8.5.0 (Current)Myles Borins
Notable Changes * build: * Snapshots are now re-enabled in V8 https://github.com/nodejs/node/pull/14875 * console: * Implement minimal `console.group()`. https://github.com/nodejs/node/pull/14910 * deps: * upgrade libuv to 1.14.1 https://github.com/nodejs/node/pull/14866 * update nghttp2 to v1.25.0 https://github.com/nodejs/node/pull/14955 * dns: * Add `verbatim` option to dns.lookup(). When true, results from the DNS resolver are passed on as-is, without the reshuffling that Node.js otherwise does that puts IPv4 addresses before IPv6 addresses. https://github.com/nodejs/node/pull/14731 * fs: * add fs.copyFile and fs.copyFileSync which allows for more efficient copying of files. https://github.com/nodejs/node/pull/15034 * inspector: * Enable async stack traces https://github.com/nodejs/node/pull/13870 * module: * Add support for ESM. This is currently behind the `--experimental-modules` flag and requires the .mjs extension. `node --experimental-modules index.mjs` https://github.com/nodejs/node/pull/14369 * napi: * implement promise https://github.com/nodejs/node/pull/14365 * os: * Add support for CIDR notation to the output of the networkInterfaces() method. https://github.com/nodejs/node/pull/14307 * perf_hooks: * 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, as is a Node.js specific flavor of the Frame Timing for measuring event loop duration. https://github.com/nodejs/node/pull/14680 * tls: * multiple PFX in createSecureContext [#14793](https://github.com/nodejs/node/pull/14793) * Added new collaborators: * BridgeAR – Ruben Bridgewater PR-URL: https://github.com/nodejs/node/pull/15308
2017-09-01doc,lib,src,test: strip executable bits off filesAnna Henningsen
Remove the executable bits of the file modes of some files that accidentally received it. PR-URL: https://github.com/nodejs/node/pull/15132 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-25perf_hooks: mark as experimentalJames M Snell
PR-URL: https://github.com/nodejs/node/pull/14997 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2017-08-23perf_hooks: implementation of the perf timing APIJames M Snell
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>