Skip to content

perf: use Error.prepareStackTrace#771

Merged
gajus merged 3 commits into
mainfrom
gajus/refactor-error-stack
Apr 6, 2026
Merged

perf: use Error.prepareStackTrace#771
gajus merged 3 commits into
mainfrom
gajus/refactor-error-stack

Conversation

@gajus
Copy link
Copy Markdown
Owner

@gajus gajus commented Apr 6, 2026

Right now Slonik's captureStackTrace:

  1. Creates new Error() – V8 serializes the entire stack to a string
  2. Splits and regex-parses every line
  3. Stores all frames in an array
  4. Then our interceptor iterates again to find the first app frame

With Error.prepareStackTrace, V8 gives us structured CallSite objects directly – no string serialization, no regex.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 6, 2026

🦋 Changeset detected

Latest commit: b5f4526

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

This PR includes changesets to release 14 packages
Name Type
slonik Minor
@slonik/benchmark Minor
@slonik/driver Minor
@slonik/errors Minor
@slonik/pg-driver Minor
@slonik/dataloaders Minor
@slonik/sql-tag Minor
@slonik/test-ssls Minor
@slonik/types Minor
@slonik/utilities Minor
slonik-interceptor-field-name-transformation Minor
slonik-interceptor-query-cache Minor
slonik-interceptor-query-logging Minor
slonik-sql-tag-raw Minor

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

@gajus gajus merged commit 21a8b5a into main Apr 6, 2026
4 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 6, 2026
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.

1 participant