8000 Buffer.length became significantelly slower in 3.x · Issue #2463 · nodejs/node · GitHub
[go: up one dir, main page]

Skip to content

Buffer.length became significantelly slower in 3.x  #2463

@matklad

Description

@matklad

May be it's a know issue, but I was surprised to discover this behavior in my benchmarks.

Consider this two snippets of code:

for (var i = 0; i < buffer.length; i++) {
    ...
}

and

var length = buffer.length;
for (var i = 0; i < length; i++) {
    ...
}

under v2.5.0 their performance is indistinguishable, but under v3.0.0 or v3.1.0 the first version causes 1.5x slowdown of my whole benchmark.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bufferIssues and PRs related to the buffer subsystem.v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0