Skip to content

Slow Array.includes in dev #16986

@hmnd

Description

@hmnd

Describe the bug

While using #16930 in my project, I noticed that actions which triggered eager effects were taking longer than expected. It seems this array.includes hijack is a major culprit. Perhaps there should be a way for internal function to opt out of these dev mode polyfills?

This identical operation is several orders of magnitude slower time as a result:

Image

with

Image

without

Reproduction

Use array.includes

Logs

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (5) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 20.19.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @sveltejs/adapter-auto: ^3.0.0 => 3.3.1 
    @sveltejs/kit: ^2.5.27 => 2.47.1 
    @sveltejs/vite-plugin-svelte: ^5.0.0 => 5.1.1 
    svelte: ^5 => 5.41.0 
    vite: ^6.0.0 => 6.4.0

Severity

annoyance

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