Skip to content

perf: skip location flush when nothing is pending - #251

Merged
manuel3108 merged 1 commit into
mainfrom
perf/printer-speed
Oct 17, 2026
Merged

manuel3108 merged 1 commit into
mainfrom
perf/printer-speed

Conversation

@jycouet

@jycouet jycouet commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

as flush_locations() is in the hot path and pending_locations is almost always empty, Returning early makes printing 5 to 20% faster depending on the file size (tested with 2Kb to 7Mb, with or without sourcemaps.). All tests are unchanged !

@pkg-svelte-dev

Copy link
Copy Markdown

Install the latest version of esrap from 32a6c42:

pnpm add https://pkg.svelte.dev/esrap/c/32a6c42f06dd46edc2c44e2423149cbf6c64cb68

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/esrap/pr/251

@changeset-bot

changeset-bot Bot commented Oct 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 32a6c42

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
esrap Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@manuel3108
manuel3108 merged commit 6c01c1a into main Oct 17, 2026
7 checks passed
@manuel3108
manuel3108 deleted the perf/printer-speed branch October 17, 2026 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants