b7e97d6a
codegen: inline 2-byte tag + 2-byte LEN fast paths at decode dispatch (auj)
emitInlineDecode now inlines both the 1-byte tag fast path (field IDs 1..15,
existing) and the 2-byte tag fast path (field IDs 16..4095) directly. The
fallback to wire.decode_tag only fires for field IDs >= 4096. Same shape
applied to the string/bytes LEN prefix in emitInlineStringBytesScalar and
emitInlineStringBytesRepeated, extending the existing 1-byte LEN inline
with a 2-byte branch — covers lengths 0..16383 without crossing a function
frame.
Why this matters: the original auj bridge ('multi-byte varint' side trace
tr9 off Person_decode's tr5 at pc=55) was the tag fast path's 2+ byte
guard exiting to a side trace that couldn't stitch back through
wire.decode_tag's frame return. Inlining the 2-byte case literally keeps
the side trace inside the parent's own frame.
Throughput on the multi-byte-varint Person fixture (full mode, no
PB_ENABLE_C, 5-run median):
small (1-byte tags+lens+vars) 14.0 -> 14.2 MB/s (noise)
big (2-byte LEN + multi-byte packed) 31.6 -> 34.7 MB/s (+10%)
Bridge rate at full/Person_decode multi-byte varint:
before (this session) 0/50 (already self-resolved after kot/21d/2ri/aah)
after 4/100 (residual now in the packed-varint loop,
migrated from the tag site; eliminating
fully requires per-scalar-type 2-byte
inline in the packed-loop emitter)
Suites: test 766/766, test-c 1057/1057, examples all green.
Eugene Blikh <bigbes@gmail.com> — 2026-05-24 20:09:20 UTC
Commit b7e97d6a1ed1ba37d46a9cfc85c32b8ced751cf6 —
view raw patch
Parent(s):
ff1ce60f
| File | Status | + | − |
|---|---|---|---|
.beads/issues.jsonl
|
M | +1 | -1 |
cmd/protoc-gen-tarantool/internal/gen/inline.go
|
M | +66 | -12 |
examples/expected/full/c_int64/c_int64_pb.lua
|
M | +28 | -2 |
examples/expected/full/c_nested/c_nested_pb.lua
|
M | +140 | -10 |
examples/expected/full/c_repeated/c_repeated_pb.lua
|
M | +162 | -8 |
examples/expected/full/conformance/conformance_pb.lua
|
M | +703 | -12 |
examples/expected/full/hello/hello_pb.lua
|
M | +511 | -19 |
examples/expected/full/proto2_basic/proto2_basic_pb.lua
|
M | +489 | -26 |
examples/expected/full/protobuf_test_messages/proto2/test_messages_proto2_pb.lua
|
M | +1312 | -44 |
examples/expected/full/protobuf_test_messages/proto3/test_messages_proto3_pb.lua
|
M | +463 | -8 |
examples/expected/full/quickstart/quickstart_pb.lua
|
M | +94 | -2 |