Reduce-accumulator scalar replacement: lower (reduce (fn [acc x] body) (->Rec inits) coll) with a non-escaping record accumulator to a loop carrying the acc fields as scalar vars. Correct (run-reduce-sroa.ss 7/7, make test + shakesmoke green) but a PERF REGRESSION: ray tracer hit-all 38.4s -> ~53s. Root cause: jolt's reduce already iterates a vector with vec-reduce (seq.ss) — a tight index loop over the backing store, zero per-element allocation. Lowering to a (seq)/(first)/(next) loop allocates a seq node per element, trading hit-all's CONDITIONAL ->HitAcc allocation for a per-element seq allocation. The targeted accumulator allocation is also conditional (only on hit improvement), not the dominant per-sphere cost. Kept on this branch for reference; not merged. |
||
|---|---|---|
| .. | ||
| clojure/core | ||
| jolt | ||