5c541416
bench(c_accel): drop defensive lua_type checks; refresh numbers
person_codec.c had a per-element lua_type(L,-1)==LUA_TSTRING check inside the emails loop, plus field-level lua_type checks that generic_codec.c skipped. At 100KB that's ~2700 extra C calls per message in the hot path, which made S4 (hand-written) look slower than S3 (generic) at 1KB+ and led to a wrong "branch prediction on divergent paths" hypothesis in the original README. Replaced the per-element check with no check and the field-level lua_type checks with lua_isnil to match generic_codec.c's semantics. S3 and S4 are now within +/-5% at every size, which strengthens the ra6 architecture call (ship the generic one-call codec; codegen- emitted per-message C buys nothing). Also added bench/c_accel/compile_flags.txt so clangd resolves <module.h> and friends -- mirrors runtime/pb/c/compile_flags.txt.
Eugene Blikh <bigbes@gmail.com> — 2026-05-23 09:17:51 UTC
Commit 5c5414165838069d5fcfc199bf1ebf9690c7c3c8 —
view raw patch
Parent(s):
569bc3c9
| File | Status | + | − |
|---|---|---|---|
bench/c_accel/README.md
|
M | +41 | -24 |
bench/c_accel/compile_flags.txt
|
A | +7 | |
bench/c_accel/person_codec.c
|
M | +19 | -13 |