-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
performance.timerify(fn, options) always return the same timerifed function #42742
Labels
confirmed-bug
Issues with confirmed bugs.
perf_hooks
Issues and PRs related to the implementation of the Performance Timing API.
Comments
VoltrexKeyva
added
the
perf_hooks
Issues and PRs related to the implementation of the Performance Timing API.
label
Apr 14, 2022
Related: node/lib/internal/perf/timerify.js Lines 74 to 123 in a75d4e2
|
Upstream PR: #37136 It seems like the memorization is for the performance |
I'm working on this issue |
himself65
added a commit
to himself65/node
that referenced
this issue
Apr 24, 2022
himself65
added a commit
to himself65/node
that referenced
this issue
Apr 24, 2022
himself65
added a commit
to himself65/node
that referenced
this issue
Apr 28, 2022
himself65
added a commit
to himself65/node
that referenced
this issue
Apr 28, 2022
Co-authored-by: HE Shi-Jun <hax@heshijun.net> Fixes: nodejs#42742
himself65
added a commit
to himself65/node
that referenced
this issue
Apr 29, 2022
Fixes: nodejs#42742 Co-authored-by: HE Shi-Jun <hax@heshijun.net>
himself65
added a commit
to himself65/node
that referenced
this issue
Apr 30, 2022
Fixes: nodejs#42742 Co-authored-by: HE Shi-Jun <hax@heshijun.net>
guangwong
pushed a commit
to noslate-project/node
that referenced
this issue
Oct 10, 2022
Fixes: nodejs/node#42742 PR-URL: nodejs/node#42854 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Co-authored-by: HE Shi-Jun <hax@heshijun.net>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
confirmed-bug
Issues with confirmed bugs.
perf_hooks
Issues and PRs related to the implementation of the Performance Timing API.
Version
master branch
Platform
All
Subsystem
perf_hooks
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior?
Every calls of
performance.timerify(fn)
should return a new timerified function instance forfn
, at least ifoptions
is provided.What do you see instead?
Currently
timerify
will cache the timerfied function asfn[kTimerified]
, sotimerify(fn)
always return same timerified function forfn
, even differentoptions
was given.Additional information
Current cache behavior is not very useful, and cause problems for the use cases which need multiple timerified versions (for example, record timing for different usage of the same function).
PS. It also will throw if
fn
is frozen/sealed/non-extensible.The text was updated successfully, but these errors were encountered: