-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Closed
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.perf_hooksIssues and PRs related to the implementation of the Performance Timing API.Issues and PRs related to the implementation of the Performance Timing API.
Description
Version
master branch
Platform
All
Subsystem
perf_hooks
What steps will reproduce the bug?
function f() {}
let h1 = perf_hooks.createHistogram()
let h2 = perf_hooks.createHistogram()
let f1 = perf_hooks.performance.timerify(f, {histogram: h1})
let f2 = perf_hooks.performance.timerify(f, {histogram: h2})
f1 !== f2 // expect true, actual false
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 for fn
, at least if options
is provided.
What do you see instead?
Currently timerify
will cache the timerfied function as fn[kTimerified]
, so timerify(fn)
always return same timerified function for fn
, even different options
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.
benjamingr and himself65
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.perf_hooksIssues and PRs related to the implementation of the Performance Timing API.Issues and PRs related to the implementation of the Performance Timing API.