Skip to content

Investigate Array.push performance #27

@MattiSG

Description

@MattiSG

Hi there,

I was surprised to see that Array.push was so much slower than direct assignment. The JSperf link you give looks like a good proof of this.

However, the latest revision of the same bench, which has much cleaner code, seems to remove this difference, and even show push as faster in recent Chrome versions (which I would have spontaneously thought, considering the JIT optimizations that can be done on predictable function calls rather than guessing numerical access).

Are you sure that this recommendation is still to be followed?

All the best,
Matti

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions