Skip to content

Conversation

@satur9nine
Copy link
Contributor

@satur9nine satur9nine commented Nov 9, 2025

  • Builder startup work is cheaper: StartObject now seeds vtable state with [0] * numfields, lazy create sharedStrings dict to speed up objects with no strings

  • Offset/Pad/Prep all work off cached head/buffer lengths and zero-fill via slices

  • Prepend now handles alignment + byte writes in one pass

  • Vtable write is batched: WriteVtable gathers all field offsets plus metadata and streams them

Performance is 1.6x faster: old time: 63.0 us, new time 39.2 us

before_perf.txt
after_perf.txt

@google-cla
Copy link

google-cla bot commented Nov 9, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot added the python label Nov 9, 2025
@satur9nine satur9nine force-pushed the python-perf branch 4 times, most recently from 8396420 to ec85faf Compare November 15, 2025 19:55
@satur9nine satur9nine changed the title Increase python performance [Python] Increase python builder performance Nov 15, 2025
@satur9nine satur9nine changed the title [Python] Increase python builder performance [Python] Improve python builder performance Nov 15, 2025
@satur9nine satur9nine force-pushed the python-perf branch 2 times, most recently from 89b94cf to c2467b0 Compare November 18, 2025 17:55
- Builder startup work is cheaper: StartObject now seeds vtable state
  with [0] * numfields, lazy create sharedStrings dict to speed up
  objects with no strings

- Offset/Pad/Prep all work off cached head/buffer lengths and zero-fill
  via slices

- Prepend now handles alignment + byte writes in one pass

- Vtable write is batched: WriteVtable gathers all field offsets plus
  metadata and streams them
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant