Skip to content

Reduce per-query allocations for protocol messages - #270

Merged
SeanTAllen merged 1 commit into
mainfrom
static-protocol-messages
Oct 17, 2026
Merged

SeanTAllen merged 1 commit into
mainfrom
static-protocol-messages

Conversation

@SeanTAllen

Copy link
Copy Markdown
Member

sync(), flush(), describe_portal(""), and execute_msg("", 0) produce identical output on every call. The Pony compiler interns Array[U8] val literals as static data in .rodata — zero allocation per call, single lea returning a pointer.

sync() and flush() replace the entire body. describe_portal() and execute_msg() add a fast path for the common empty-portal / zero-max-rows case; the general path is unchanged.

@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Oct 17, 2026
@SeanTAllen SeanTAllen added the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Oct 17, 2026
@SeanTAllen SeanTAllen changed the title Replace computed wire messages with interned static arrays Reduce per-query allocations for protocol messages Oct 17, 2026
@SeanTAllen
SeanTAllen force-pushed the static-protocol-messages branch 3 times, most recently from b8f44bd to 7ec8ca7 Compare October 17, 2026 20:59
sync(), flush(), describe_portal(""), and execute_msg("", 0) produce
identical output on every call. The Pony compiler interns Array[U8] val
literals as static data in .rodata — zero allocation, single lea.
@SeanTAllen
SeanTAllen force-pushed the static-protocol-messages branch from 7ec8ca7 to ad543d8 Compare October 17, 2026 21:00
@SeanTAllen
SeanTAllen merged commit e042739 into main Oct 17, 2026
6 checks passed
@SeanTAllen
SeanTAllen deleted the static-protocol-messages branch October 17, 2026 21:07
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Oct 17, 2026
github-actions Bot pushed a commit that referenced this pull request Oct 17, 2026
github-actions Bot pushed a commit that referenced this pull request Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants