Repository navigation
Benchmark! #242
bomabomertest
started this conversation in
Show and tell
Benchmark!
#242
Replies: 1 comment
|
ty for those results, would love some kind of repository for reproduction |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Goose vs Rust — my own benchmark (2026-11-06)
Machine: CachyOS, Intel i3-1000NG4 (2c/4t, 1.1–3.5 GHz), 7.6 GB RAM, single-threaded workloads.
Goose v2026.3 prebuilt release (
goose build, native binaries; default C backend gcc 16.2.1 unless noted).Rust 1.99.1,
rustc -O(LLVM). No-march=native/target-cputricks on either side.Whole-process wall time, best of 5 runs (median within ~5%); peak RSS via
os.wait4.Every pair of implementations prints the identical checksum — semantically verified, not just similar code.
Vec+StringVec::with_capacityOption<Box>chain (16B nodes)Vec+u32 index arena (8B nodes)Speed ratios (Goose vs Rust)
data layout: one contiguous block, no per-String allocation, zero alloc/free churn. This is
the pointer/allocation-rich regime of the repo's own claims, and it reproduces.
Boxidiom. Goose's packed 8-byte nodes with 4-byte relative links match a hand-pickedRust arena representation, without having to choose it.
gcc-built default is 2.3x slower — a backend artifact, not language: the generated C
contains no SIMD under gcc while clang/LLVM vectorize the identical C. Goose bce had
already elided 12/12 bounds checks;
rustcproves the same checks away.Peak memory
Honest caveats
treat ratios, not milliseconds, as the result. Runs are single-threaded.
buildused its default C codegen (gcc -O2); Rust used opt-level 3. For blur Iadditionally built the same generated C with clang to de-confound — the tie is with the
same backend as Rust's.
Vec<u8>, unsafe cells, mimalloc);those are expert-tier work, exactly what Goose automates by language rule. That is the
honest reading: idiom-for-idiom, Goose wins where data is inline/variable-size; where the
community idiom already encodes the same layout (index arena), it ties; and on flat
numeric kernels it ties or loses modulo backend.
Files
g1_records.goose/r1_records.rs,r1_records_reserve.rsg2_chain.goose/r2_chain_box.rs,r2_chain_arena.rsg3_blur.goose/r3_blur.rs(+g3_blur_clangbuild of the same C)bench.py(runner),rng.goose(from the repo, needed by blur)g*_runs via the prebuilt compiler in~/goose-release/....All reactions