FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

lib: refactor to use more primordials in internal/histogram.js by RaisinTen · Pull Request #36455 · nodejs/node · GitHub

/ node Public

lib: refactor to use more primordials in internal/histogram.js - #36455

Merged
Trott merged 1 commit into
nodejs:masterfrom
RaisinTen:lib/refactor-to-use-more-primordials-internal/histogram.js
Dec 22, 2020
Merged

lib: refactor to use more primordials in internal/histogram.js#36455
Trott merged 1 commit into
nodejs:masterfrom
RaisinTen:lib/refactor-to-use-more-primordials-internal/histogram.js

Conversation

RaisinTen commented Dec 9, 2020
edited
Loading

Copy link
Copy Markdown
Member
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

targos commented Dec 9, 2020

Copy link
Copy Markdown
Member

Why did you change private properties to symbol properties?

jasnell commented Dec 9, 2020

Copy link
Copy Markdown
Member

Why did you change private properties to symbol properties?

I presume because of the performance difference that still exists there (symbol are still faster). In this case, I would leave them as private fields.

aduh95 left a comment
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I agree with other comments here, using a symbol doesn't seem justified. An argument could be made for #handle/kHandle which is exported as a symbol anyway (although that would make possible for consumers to change the handle with another object, we'd have to make sure it won't introduce issues; I'd stick with the original code to not take any risk), but I suggest reverting changes to the #map private property.

Comment thread lib/internal/histogram.js Outdated
Comment thread lib/internal/histogram.js Outdated
Comment thread lib/internal/histogram.js Outdated
Comment thread lib/internal/histogram.js Outdated
Comment thread lib/internal/histogram.js Outdated
Comment thread lib/internal/histogram.js Outdated
Comment thread lib/internal/histogram.js Outdated

aduh95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

nit: it seems a good candidate for optional chaining

Comment thread lib/internal/histogram.js Outdated
Comment thread lib/internal/histogram.js Outdated
Comment thread lib/internal/histogram.js Outdated
Comment thread lib/internal/histogram.js Outdated
Comment thread lib/internal/histogram.js Outdated
Comment thread lib/internal/histogram.js Outdated
Comment thread lib/internal/histogram.js Outdated
Comment thread lib/internal/histogram.js Outdated
Comment thread lib/internal/histogram.js Outdated
Comment thread lib/internal/histogram.js Outdated
RaisinTen marked this pull request as ready for review December 10, 2020 15:23
RaisinTen force-pushed the lib/refactor-to-use-more-primordials-internal/histogram.js branch from 8c6fb14 to 42a535b Compare December 10, 2020 15:23

aduh95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM as long as kHandle is never exported to user-land (which seems to be the case).

aduh95 added author ready PRs that have at least one approval, no outstanding review comments, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Dec 12, 2020
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 12, 2020

Copy link
Copy Markdown
Collaborator

Trott left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM. Worth a benchmark of either quic or perf_hooks since those use this?

aduh95 added the needs-benchmark-ci PR that need a benchmark CI run. label Dec 15, 2020

Trott commented Dec 22, 2020

Copy link
Copy Markdown
Member

Trott commented Dec 22, 2020

Copy link
Copy Markdown
Member

Not sure if perf_hooks exercised the code here, but the results are good.

07:21:09  perf_hooks/bench-eventlooputil.js method='ELU_passed' n=1000000                -0.53 %       ±2.23% ±2.97% ±3.87%
07:21:09  perf_hooks/bench-eventlooputil.js method='ELU_simple' n=1000000                 0.26 %       ±3.09% ±4.12% ±5.37%
07:21:09  perf_hooks/bench-eventlooputil.js method='idleTime' n=1000000                   0.91 %       ±4.78% ±6.36% ±8.28%

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: nodejs#36455
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Trott removed the needs-benchmark-ci PR that need a benchmark CI run. label Dec 22, 2020
Trott force-pushed the lib/refactor-to-use-more-primordials-internal/histogram.js branch from 42a535b to 1623aff Compare December 22, 2020 15:33

Trott commented Dec 22, 2020

Copy link
Copy Markdown
Member

Landed in 1623aff

Trott merged commit 1623aff into nodejs:master Dec 22, 2020
RaisinTen deleted the lib/refactor-to-use-more-primordials-internal/histogram.js branch December 22, 2020 15:47
danielleadams pushed a commit that referenced this pull request Jan 12, 2021
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #36455
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
danielleadams mentioned this pull request Jan 12, 2021
targos pushed a commit that referenced this pull request May 16, 2021
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #36455
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Jun 11, 2021
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #36455
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL