Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-08-10perf_hooks: fix gc elapsed timetheanarkh
PR-URL: https://github.com/nodejs/node/pull/44058 Refs: https://github.com/nodejs/node/issues/44046 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2022-03-29net,dns: trace tcp connection and dns by perf_hookstheanarkh
use the perf_hooks to trace the time spent by net.connect, dns.lookup, dns.lookupService, dns.resolvexxx. PR-URL: https://github.com/nodejs/node/pull/42390 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2021-04-10http: fixup perf regressionJames M Snell
Only call into hrtime if there's an observer Also, fix up some previously missed changes from the original refactor Signed-off-by: James M Snell <jasnell@gmail.com> Refs: https://github.com/nodejs/node/issues/37937 Refs: https://github.com/nodejs/node/pull/37136 PR-URL: https://github.com/nodejs/node/pull/38110 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-02-22perf_hooks: complete overhaul of the implementationJames M Snell
* Update the user timing implementation to conform to User Timing Level 3. * Reimplement user timing and timerify with pure JavaScript implementations * Simplify the C++ implementation for gc and http2 perf * Runtime deprecate additional perf entry properties in favor of the standard detail argument * Disable the `buffered` option on PerformanceObserver, all entries are queued and dispatched on setImmediate. Only entries with active observers are buffered. * This does remove the user timing and timerify trace events. Because the trace_events are still considered experimental, those can be removed without a deprecation cycle. They are removed to improve performance and reduce complexity. Old: `perf_hooks/usertiming.js n=100000: 92,378.01249733355` New: perf_hooks/usertiming.js n=100000: 270,393.5280638482` PR-URL: https://github.com/nodejs/node/pull/37136 Refs: https://github.com/nodejs/diagnostics/issues/464 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-12-04src: rename AliasedBufferInfo->AliasedBufferIndexDaniel Bevenius
This commit suggest renaming AlaisedBufferInfo to AlaisedBufferIndex to make the code more readable. The main motivation for this change is that I personally think that the following code could be a little clearer: context->GetDataFromSnapshotOnce<V8T>(*info_).ToLocalChecked(); Even knowing that GetDataFromSnapshotOnce takes a size_t I had to double check the type of info_ to make sure. PR-URL: https://github.com/nodejs/node/pull/36339 Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-10-05src: fix aliased buffer import warning in env.hYash Ladha
Alliased buffer header is not imported in the `env.h` file due to which the language server is giving an error. Fixed it via importing the header file for "aliased_buffer.h" PR-URL: https://github.com/nodejs/node/pull/35436 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-07-18src: snapshot Environment upon instantiationJoyee Cheung
This includes the initial Environment (without running bootstrap scripts) into the builtin snapshot PR-URL: https://github.com/nodejs/node/pull/32984 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2020-04-02src: align PerformanceState class name with conventionsAnna Henningsen
Class names are written in UpperCamelCase. Otherwise, this looks like it’s a variable, not a class name. PR-URL: https://github.com/nodejs/node/pull/32539 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-07-12perf_hooks: add HttpRequest statistics monitoring #28445vmarchaud
```js const { PerformanceObserver, performance } = require('perf_hooks'); const http = require('http'); const obs = new PerformanceObserver((items) => { const entry = items.getEntries()[0]; console.log(entry.name, entry.duration); }); obs.observe({ entryTypes: ['http'] }); const server = http.Server(function(req, res) { server.close(); res.writeHead(200); res.end('hello world\n'); }); server.listen(0, function() { const req = http.request({ port: this.address().port, path: '/', method: 'POST' }).end(); }); ``` PR-URL: https://github.com/nodejs/node/pull/28486 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-04-26src: use predefined AliasedBuffer types in the code baseJoyee Cheung
Instead of allowing the callers to instantiate the template with any numeric types (such as aliasing a Uint8Array to double[]), predefine types that make sense and use those instead. PR-URL: https://github.com/nodejs/node/pull/27334 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-18src: unify uptime base used across the code baseJoyee Cheung
This patch joins `per_process::prog_start_time` (a double) and `performance::performance_node_start` (a uint64_t) into a `per_process::node_start_time` (a uint64_t) which gets initialized in `node::Start()`. PR-URL: https://github.com/nodejs/node/pull/26016 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-01-21src: reduce includes of node_internals.hJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/25507 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-12-17perf_hooks: make GC tracking state per-EnvironmentAnna Henningsen
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>
2018-08-28src: add missing `NODE_WANT_INTERNALS` guardsAnna Henningsen
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>
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-03-16perf_hooks,trace_events: emit perf milestone trace eventsJames M Snell
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>
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-01-25http2,perf_hooks: perf state using AliasedBufferKyle Farnung
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>
2018-01-02http2: perf_hooks integrationJames M Snell
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>
2017-08-24src: fix build on certain platformsAnna Henningsen
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>
2017-08-24perf_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>