Skip to content

Sourcemap generation is slow on big 3rd party libraries #6056

@pascalspadone

Description

@pascalspadone

Rollup Version

4.440 - 4.46.2

Operating System (or Browser)

mac, linux

Node Version (if applicable)

No response

Link To Reproduction

https://github.com/pascalspadone/rollup-sourcemap-gen-perf

Expected Behaviour

There seems to be a performance regression in rollup 4.44.0 when generating sourcemaps for huge 3 party libraries. This seems to have been introduced by #5985 (I did go as far as reverting manually just this PR in my node_modules). Besides, the PR's reviewer did mention the change might cause perf issues.

There are more detailed measurements in the README of the linked repo, but the sourcmap generation (for that repo) goes from about 3 seconds to about 30 seconds.

Note that I am not necessarily expecting a revert or improvement of #5985 . I am aware that generating sourcemaps for a 8MB lib that comes only in minified form is a waste of electricity. If this is deemed a good idea, I could open a PR to add an option to exclude some chucks from sourcemap generation (following the general idea of https://gist.github.com/seyanaracore/a627fb40a82cd1bf02d3f275c2cb3d77 )

Actual Behaviour

With rollup 4.44.0 (tested with 4.46.2 too), source map generation on the linked repository takes about 30 seconds, instead of about 3s with rollup 4.43.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions