Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! perf_hooks: reducing overhead of performance observer entry list
  • Loading branch information
H4ad committed Oct 2, 2023
commit 8a2a5337483a00ba85b46bebe7bd06993cb3d594
9 changes: 3 additions & 6 deletions lib/internal/perf/observe.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,6 @@ ObjectDefineProperties(PerformanceObserverEntryList.prototype, {
},
});

function createPerformanceObserverEntryList(entries) {
return new PerformanceObserverEntryList(kSkipThrow, entries);
}

class PerformanceObserver {
#buffer = [];
#entryTypes = new SafeSet();
Expand Down Expand Up @@ -353,8 +349,9 @@ class PerformanceObserver {
}

[kDispatch]() {
this.#callback(createPerformanceObserverEntryList(this.takeRecords()),
this);
const entryList = new PerformanceObserverEntryList(kSkipThrow, this.takeRecords());

this.#callback(entryList, this);
}

[kInspect](depth, options) {
Expand Down