Skip to content

The performance gap between node16 and node21 changes as the n of the benchmark changes #50571

Closed
@Septa2112

Description

@Septa2112

Version

node 16.x and node 21.1

Platform

Linux wpe-icx 6.2.0-26-generic #26~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Jul 13 16:27:29 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

I tested node-benchmark es/string-concatenations.js with node 21.1 and node 16.x.

When n is the default 1e3, the score difference between the two version reaches 50%.

But when n is set to 5000 or 10000 or other larger numbers, there is no performance gap between the two versions.

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

No response

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

Expected

  • When I adjust n to 5e3 or 1e4, the score difference between the two versions should remain around 50%.

Reason

  • I think the number of n has not changed much, and the performance gap between node 16.x and node 21.1 should not change so much too.

What do you see instead?

  • n = 1e3 (default number)
NODE 16.x  es/string-concatenations.js mode="multi-join" n=1000: 2,275,198.9661495895
NODE 21.1  es/string-concatenations.js mode="multi-join" n=1000: 975,159.7555469525
  • n = 5e3
NODE 16.x  es/string-concatenations.js mode="multi-join" n=5000: 1,972,248.1025001006
NODE 21.1  es/string-concatenations.js mode="multi-join" n=5000: 1,983,125.977681107
  • n = 1e4
NODE 16.x  es/string-concatenations.js mode="multi-join" n=10000: 2,678,989.303063612
NODE 21.1  es/string-concatenations.js mode="multi-join" n=10000: 2,739,590.924283186

Additional information

I'm not sure whether this problem can be counted as an issue. Or is this a pre-existing problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    benchmarkIssues and PRs related to the benchmark subsystem.good first issueIssues that are suitable for first-time contributors.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