Uh oh!
There was an error while loading. Please reload this page.
process: implement process.hrtime.bigint() - #21256
Conversation
joyeecheung
commented
Jun 11, 2018
devsnek
left a comment
There was a problem hiding this comment.
is it still a perf boost to use the ArrayBuffer when it's just one value?
@devsnek I don't think it makes much difference, probably can save an allocation depending on the situation though. |
There was a problem hiding this comment.
Was this supposed to be 1000000552n?
There was a problem hiding this comment.
While useful for the array-based method, I don’t think this feature is that useful now one can just subtract the times directly…
There was a problem hiding this comment.
@TimothyGu Yeah come to think of it, it does seem unnecessary. I'll remove it.
There was a problem hiding this comment.
I’d also appreciate some benchmarking showing that the ArrayBuffer-based approach is faster than just returning the bigint.
There was a problem hiding this comment.
@TimothyGu There are no APIs for constructing a BigInt out of a uint64_t at the moment, it seems.
There was a problem hiding this comment.
I could add one for uint64_t, but there is a discussion going on about the general API design of BigInt: https://bugs.chromium.org/p/v8/issues/detail?id=7712 A simple overload would be ambiguous anyway.
apapirovski
left a comment
There was a problem hiding this comment.
I'm +1 on the addition but I'm not a fan of the scoping. Has there been some discussion around this? Personally I'm not a huge fan of putting bigint functions on top of existing functions. The naming ends up being pretty non-obvious plus it's an extra property lookup. Even hrtimeBigInt is more appealing to me, personally.
joyeecheung
commented
Jun 13, 2018
@apapirovski The naming is following the convention of The extra lookup can be avoided if the user assign the function to an identifier first (also if they are already using Another idea would be to expose a symbol similar to |
joyeecheung
commented
Jun 13, 2018
For reference: there is also whatwg/webidl#525 and w3c/IndexedDB#231 cc @littledan do you have any suggestion regarding how to expose variants of existing APIs that support BigInt? |
There was a problem hiding this comment.
Hmm, seeing this we probably want a note in the documentation for process.hrtime() that the BigInt equivalent is preferred.
joyeecheung
commented
Jun 16, 2018
Rebased and addressed nits: https://ci.nodejs.org/job/node-test-pull-request/15494/ |
joyeecheung
commented
Jun 17, 2018
CI is green. @apapirovski is your review in #21256 (review) blocking? |
apapirovski
left a comment
There was a problem hiding this comment.
@joyeecheung nope, it wasn't. :)
joyeecheung
commented
Jun 17, 2018
Landed in 1d8a231, thanks! |
PR-URL: #21256 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
targos
commented
Jun 19, 2018
Depends on #21105 to land on v10.x-staging. |
PR-URL: #21256 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Notable changes: * console: * The `console.timeLog()` method has been implemented. (#21312) * deps: * Upgrade to libuv 1.22.0. (#21731) * Upgrade to ICU 62.1 (Unicode 11, CLDR 33.1). (#21728) * http: * Added support for passing both `timeout` and `agent` options to `http.request`. (#21204) * napi: * Added experimental support for functions dealing with bigint numbers. (#21226) * process: * The `process.hrtime.bigint()` method has been implemented. (#21256) * Added the `--title` command line argument to set the process title on startup. (#21477) * trace_events: * Added process_name metadata. (#21477)
Notable changes: * console: * The `console.timeLog()` method has been implemented. (#21312) * deps: * Upgrade to libuv 1.22.0. (#21731) * Upgrade to ICU 62.1 (Unicode 11, CLDR 33.1). (#21728) * http: * Added support for passing both `timeout` and `agent` options to `http.request`. (#21204) * napi: * Added experimental support for functions dealing with bigint numbers. (#21226) * process: * The `process.hrtime.bigint()` method has been implemented. (#21256) * Added the `--title` command line argument to set the process title on startup. (#21477) * trace_events: * Added process_name metadata. (#21477) * Added new collaborators * codebytere - Shelley Vohr PR-URL: #21851
Notable changes: * console: * The `console.timeLog()` method has been implemented. (#21312) * deps: * Upgrade to libuv 1.22.0. (#21731) * Upgrade to ICU 62.1 (Unicode 11, CLDR 33.1). (#21728) * http: * Added support for passing both `timeout` and `agent` options to `http.request`. (#21204) * inspector: * Expose the original console API in `require('inspector').console`. (#21659) * napi: * Added experimental support for functions dealing with bigint numbers. (#21226) * process: * The `process.hrtime.bigint()` method has been implemented. (#21256) * Added the `--title` command line argument to set the process title on startup. (#21477) * trace_events: * Added process_name metadata. (#21477) * Added new collaborators * codebytere - Shelley Vohr PR-URL: #21851
Notable changes: * console: * The `console.timeLog()` method has been implemented. (#21312) * deps: * Upgrade to libuv 1.22.0. (#21731) * Upgrade to ICU 62.1 (Unicode 11, CLDR 33.1). (#21728) * http: * Added support for passing both `timeout` and `agent` options to `http.request`. (#21204) * inspector: * Expose the original console API in `require('inspector').console`. (#21659) * napi: * Added experimental support for functions dealing with bigint numbers. (#21226) * process: * The `process.hrtime.bigint()` method has been implemented. (#21256) * Added the `--title` command line argument to set the process title on startup. (#21477) * trace_events: * Added process_name metadata. (#21477) * Added new collaborators * codebytere - Shelley Vohr PR-URL: #21851
The first commit is from #21255
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes