You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit feb429d
Browse filesBrowse the repository at this point in the historyBrowse files
v1.0.9
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);
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -155,7 +155,7 @@ These two only exist on `PiperNoLen` and are how you turn an unknown-length pipe
155
155
156
156
Sometimes your pipeline needs to lug around different types at different steps. `Erase` gives up the compile-time type so you can work with `any`, and `Collect` puts a type back on.
157
157
158
-
-:frog:`Erase() Piper[any]` (or `PiperNoLen[any]`) -- every element becomes `any` (backed by a pointer to the original value).
158
+
-:frog:`Erase() Piper[any]` (or `PiperNoLen[any]`) -- every element becomes `any` (each backed by a `*T`, a pointer to the value).
159
159
-:frog:`pipe.Collect[DstT](Piper[any]) Piper[DstT]` -- pull a `Piper[any]` back into a concrete `Piper[DstT]`.
160
160
-:frog:`pipe.CollectNL[DstT](PiperNoLen[any]) PiperNoLen[DstT]` -- the same for a pipe with no known length.
0 commit comments