Skip to content

import.meta.url plugin is very slow for large filesΒ #207

@whitequark

Description

@whitequark

Consider this example: import-meta-url-slow.zip

With source maps disabled, adding metaUrlPlugin() increases runtime from ~80ms to ~1200ms; with source maps enabled, it is ~120ms to ~3400ms. Given that using this plugin also causes every page load to cause potentially multiple rebuilds, the resulting experience is quite awful.

To be clear, I do actually use import.meta.url in the problematic large files. I am not sure why exactly it is slow: while the resource*.js files are fairly large, most of the size is concentrated in a few strings. By any chance, are you repeatedly replacing a part of a JS string? (I haven't profiled it.)

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