Skip to content

WeakRef has slow performance & degrades runtime performance #52444

Open
@btakita

Description

@btakita

Version

21.7.2

Platform

Linux logos 6.8.4-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 05 Apr 2024 00:14:23 +0000 x86_64 GNU/Linux

Subsystem

V8?

What steps will reproduce the bug?

Install & run the following benchmark as a file.

https://github.com/btakita/weakref-benchmark

Notice that the bunjs is consistent. The Nodejs runtime has a dramatic degradation in performance as soon as WeakRef enters the benchmark.

How often does it reproduce? Is there a required condition?

Every time many WeakRef objects are instantiated.

What is the expected behavior? Why is that the expected behavior?

WeakRef should not cause performance degradation in the nodejs runtime.

What do you see instead?

WeakRef causes performance degradation in the nodejs runtime.

Additional information

I have not done any profiling yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceIssues and PRs related to the performance of Node.js.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions