perf: add benches for Option, ResultAsync, and Records#9
Merged
Conversation
Round out CodSpeed coverage so every non-trivial namespace has benchmarks tracking it — previously only pipe, Arrays, and Result were instrumented. Added: - option/transform.bench.ts — map / flatMap / filter across some vs none paths; 5-deep flatMap pipelines for both happy and short-circuit. - result-async/transform.bench.ts — map / flatMap across ok vs err; 5-deep ResultAsync.map chain compared head-to-head with a bare Promise.then chain so regressions in the async overhead show up. - records/transform.bench.ts — mapValues vs handwritten reduce (small + medium), filter under three selectivity regimes, mapKeys rename. - records/access.bench.ts — get/getOr hit vs miss, keys/values/entries vs native Object.*. No public-API changes. Every bench file uses realistic data shapes (user ids, per-user aggregates) instead of foo/bar placeholders. Local results are illustrative only; the CodSpeed CI run on this PR establishes the first baseline for these namespaces. Future PRs that change hot paths in any of them will automatically get a per-bench regression comment on the PR.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9 +/- ##
=======================================
Coverage 88.41% 88.41%
=======================================
Files 23 23
Lines 397 397
Branches 90 90
=======================================
Hits 351 351
Misses 15 15
Partials 31 31
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Merging this PR will not alter performance
Performance Changes
Comparing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Round out CodSpeed coverage so every non-trivial namespace has benchmarks tracking it. Previously only `pipe`, `Arrays`, and `Result` were instrumented; this PR adds Option, ResultAsync, and Records.
New bench files
Why these benches
No API changes
Purely bench additions. All 224 tests still pass, typecheck clean, TypeDoc regenerates clean.
First baseline
The CodSpeed CI run on this PR establishes the first baseline for these 4 files. Future PRs that touch Option/ResultAsync/Records hot paths will automatically get a per-bench regression comment.
Test plan