Repository navigation
perf: string and vector hot paths (CLJW-PERF-STRINGS-COLLS) - #85
Merged
Merged
Conversation
clojure.string/join walks its coll natively (O-070); upper/lower-case fold all-ASCII input byte-wise (O-071); split reuses one regex VM and bulk-builds its vector (O-072); subvec answers the in-bounds int case in one native step (O-073); vector node copies write each slot once (O-074). bench/vs_bb in-proc vs bb: string_ops 9.33x -> 2.27x, vector_assoc 3.24x -> 1.94x. Smell-audited: 1: fast paths fall back to the unchanged general path on any other shape
str of string/int/nil args concatenates in a stack buffer (O-075); keyword intern probes with a stack-built key so a hit allocates nothing (O-076); dorun walks natively, a realized chunk at a time (O-077). Micro, ReleaseSafe: (str "item-" i "-x") x500k 316 -> 144 ms, (keyword "abc") x500k 235 -> 104 ms, doall over map 225 -> 135 ms. vector_assoc in-proc A/B ~950 -> ~800 ms. Smell-audited: 1: each fast path falls back to the unchanged general path
Owner
Author
|
Smoke ( |
data/placement.yaml regenerated against the merged runtime (1462 vars). Smell-audited: 0: generated index only
.dev/optimizations.md resolved as the union of both sides (O-070..O-077 here, O-090 from #87). Smell-audited: 0: ledger union only
BuddhiLW
added a commit
that referenced
this pull request
Oct 22, 2026
.dev/optimizations.md and .dev/debt.yaml conflicted on every parallel PR on 2026-10-22 (#85, #86 against #87), always as two sides appending rows. git's union driver resolves exactly that; check_yaml and the ledger gates still validate the result. Smell-audited: 1: merge driver for a recurring mechanical conflict
BuddhiLW
added a commit
that referenced
this pull request
Oct 22, 2026
.dev/optimizations.md resolved as the union of both sides (this branch's O-080/O-081 and #85's O-070..O-077); from now on .gitattributes merges it by union. Smell-audited: 0: ledger union only
BuddhiLW
added a commit
that referenced
this pull request
Oct 22, 2026
data/placement.yaml regenerated against the merged runtime. Smell-audited: 0: generated index only
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.
Kanban 20261022150535-67056ef8. Step toward decision 20261022012219-31249feb (cljw faster than bb on every benchmark).
Changes (ledger O-070..O-077)
clojure.string/join: native walk over any seqable (wasapply str+interpose)split: one regex VM for the whole split,fromSliceresultsubvec: native in-bounds integer fast path, unchanged coercing/throwing fallbackstr: stack buffer when every arg is a string, immediate int or nildorun/doall: native walk, a realized chunk at a timeFallbacks keep the old general path, so semantics are unchanged. Spot-checked against clj/bb: join over vector/list/string/map/set with nil, char and keyword elements; split with empty pieces; ß upper-case; subvec nested, float-index, out-of-bounds and nil errors; str overflow past the buffer; keyword identity; dorun side-effect order over lazy/concat seqs.
bench/vs_bb in-proc ms (min of 3, ReleaseSafe; the box was shared with other builds)
Still slower than bb. What remains is mostly the per-call closure cost inside
map/mapv(VM call path, not in scope here) and persistent map assoc.Checks: check_core_surface, check_doc_coverage, check_placement_status (placement regenerated), check_epipe_head pass; zig build test VM + tree_walk pass in smoke.