Skip to content

Performance of splice #405

@amk221

Description

@amk221

Is there anything that can be done to improve the performance of .splice

this.data = tracked([/* 10000 items */]);
console.time('splice');
this.data.splice(0, 1);
console.timeEnd('splice');
// 10ms

vs.

this.data = [/* 10000 items */];
console.time('splice');
this.data.splice(0, 1);
console.timeEnd('splice');
// 0.002

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