Skip to content

V1.0.9

Latest

Choose a tag to compare

@koss-null koss-null released this 12 Oct 15:41

HUGE PERFORMANCE BOOST:
kill per-element allocation in Map (destination-pointer generator)

Internal GeneratorFn now writes into a caller-provided slot
(func(i int, dst *T) bool) instead of returning a fresh *T. Stages reuse one
scratch per worker, so Map stops allocating a heap box per element.

1M elements: Map 1,000,005 -> 6 allocs/op (96 -> 70 ms);
MapParallel 1,000,022 -> 25 allocs/op (43.5 -> 32.5 ms).

No exported signature changed. Behaviour: First/Any now return a pointer to a
copy (not into the source);