Skip to content

Perf/unmask tag fast path#6

Merged
scrrlt merged 7 commits into
mainfrom
perf/unmask-tag-fast-path
Mar 29, 2026
Merged

Perf/unmask tag fast path#6
scrrlt merged 7 commits into
mainfrom
perf/unmask-tag-fast-path

Conversation

@scrrlt

@scrrlt scrrlt commented Mar 29, 2026

Copy link
Copy Markdown
Owner

several improvements to the safe-tag package, focusing on performance, documentation clarity, and benchmarking. The most significant changes are the addition of a fast, non-mutating path to the unmaskTag function for common built-in objects, enhancements to documentation to clarify usage and risks, and a refactor of the benchmarking suite for better coverage and maintainability.

Performance and API Improvements:

  • Added a fast, non-mutating detection path to unmaskTag for common built-ins (Array, Date, RegExp, Map, Set, Promise, Function, Error), avoiding V8 de-optimization when possible. This is implemented via the new getInnateTag helper.
  • Updated the ultraFastTag function in fast.ts to use a safer type cast, improving type safety.

Documentation and Changelog:

  • Expanded the README.md to clarify the performance characteristics, side effects, and recommended use cases for both safeTag and unmaskTag, including details on the new fast-path logic.
  • Added a new CHANGELOG.pending.md to track unreleased changes and provide commit history since the last release.

Benchmarking and Testing:

  • Refactored bench/index.js to benchmark all tag functions (safeTag, unmaskTag, fastTag, ultraFastTag, cachedTag) in a unified, reusable format, improving the reliability and clarity of performance tests.

scrrlt and others added 7 commits March 28, 2026 20:11
perf: implement non-mutating fast-path for unmaskTag and update docum…
Bumps the npm_and_yarn group with 1 update in the / directory: [picomatch](https://github.com/micromatch/picomatch).


Updates `picomatch` from 2.3.1 to 2.3.2
- [Release notes](https://github.com/micromatch/picomatch/releases)
- [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md)
- [Commits](micromatch/picomatch@2.3.1...2.3.2)

Updates `picomatch` from 4.0.3 to 4.0.4
- [Release notes](https://github.com/micromatch/picomatch/releases)
- [Changelog](https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md)
- [Commits](micromatch/picomatch@2.3.1...2.3.2)

---
updated-dependencies:
- dependency-name: picomatch
  dependency-version: 2.3.2
  dependency-type: indirect
  dependency-group: npm_and_yarn
- dependency-name: picomatch
  dependency-version: 4.0.4
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
…n-bf05dc1ecf

Bump the npm_and_yarn group across 1 directory with 1 update
@scrrlt
scrrlt merged commit e2807bc into main Mar 29, 2026
7 checks passed
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