Tags: kjkrol/goke
Tags
perf(core): inline Page values in Memo, contiguous multi-page allocation - Memo.Pages changed from []*Page to []Page — eliminates per-page heap allocation and improves cache locality during page iteration. - New Memo.AddPages(n) allocates n pages from a single contiguous memory block, reducing allocation count for batch entity creation. - Blueprint.Create inlines page management logic and pre-allocates all required pages upfront via AddPages before filling them sequentially. - View.All and View.Filter iterate pages by pointer (&Pages[i]) to avoid 40-byte struct copies on each iteration. - Removed Memo.AllocBatch (logic inlined into generated Blueprint code).
v1.3.0 - iter.Seq-based View/Blueprint API, 10-arity, faster Get This release reshapes the public iteration API around Go 1.23+ iterators, extends generic arity from 8 to 10 components, and shaves 8.4% off the GetComponent hot path. Highlights ---------- * View.All yields SoA pages (iter.Seq) — inner loop on the caller side, full SoA layout exposed for SIMD-friendly access. * View.Filter yields iter.Seq2[int, ...] — index correlates results with the input slice and surfaces skipped entities for free. * Blueprint.Create(n) is batch-based — page-shaped slices for in-place initialization. * View9, View10 and matching blueprints. * View0.Filter for archetype membership checks. Performance (Apple M1 Max, 0 allocs/op on all hot paths) -------------------------------------------------------- * Get Component: 5.13 -> 4.70 ns/op (-8.4%) * View.Filter: 4.22 ns/ent (1 comp) ... 10.93 ns/ent (10 comp) * View.All: 0.34 ns/ent (View0) ... 1.96 ns/ent (View10) * Batch Create: 10-25 ns/ent (1-10 comp, batches of 1024) Breaking changes ---------------- Signatures of View.All, View.Filter, Blueprint.Create and GetComponent changed. See CHANGELOG.md [1.3.0] for the full migration guide. Docs: README.md, BENCHMARKS.md, doc.go all refreshed.
PreviousNext