Tags: kjkrol/goke
Tags
GOKe v2.0.0 — rewritten public API, internal engine rebuild Module path changed to github.com/kjkrol/goke/v2 (required by Go modules for any v2+ release) — update your import accordingly. Breaking changes vs v1.3.4: - Free functions (goke.Tick(ecs, d), goke.RegisterSystem(...)) replaced by methods on *ECS - View0-View10 / Blueprint1-Blueprint10 (generated, per-arity) replaced by Query/Factory/Editor built on component handles (Comp[T]) - GetComponent/SafeGetComponent/EnsureComponent removed — use Query.Seek + Comp[T].At - System.Update(Lookup, *Schedule, Duration) -> Update(*CmdBuf, Duration) - Internal package decomposition (arch/ent/comp/colstore/chunk/addr/reg/ orch/query) replaces internal/core Highlights: - Pull-based iteration (Query.All/Pick + Next()+Cursor) replaces the push-based iter.Seq API, avoiding its inlining cliff on heavy loop bodies - Zero allocations at steady state on Editor.Add/Del/Mix (chunk reuse) - Unit test coverage raised to 96-100% across all packages Full changelog: CHANGELOG.md Benchmarks: BENCHMARKS.md
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