Skip to content

Adds a utility that makes it easier to use Arena-allocated protocol buffers#45924

Open
birenroy wants to merge 4 commits into
envoyproxy:mainfrom
birenroy:proto-helper
Open

Adds a utility that makes it easier to use Arena-allocated protocol buffers#45924
birenroy wants to merge 4 commits into
envoyproxy:mainfrom
birenroy:proto-helper

Conversation

@birenroy

@birenroy birenroy commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

With this change, operations involving complex protocol buffer messages are much more efficient.

As an example, I have used the new wrapper in EdsResourcesCacheImpl, and the benchmark (added in #45926) shows an improvement to the SetResource operation.

Before:

Run on (12 X 4500 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x6)
  L1 Instruction 32 KiB (x6)
  L2 Unified 1024 KiB (x6)
  L3 Unified 8448 KiB (x1)
Load Average: 8.13, 5.26, 3.11
***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead.
***WARNING*** ASLR is enabled, the results may have unreproducible noise in them.
----------------------------------------------------------------
Benchmark                      Time             CPU   Iterations
----------------------------------------------------------------
bmSetResource/1/1            800 ns          800 ns       978841
bmSetResource/1/10          6635 ns         6634 ns       105646
bmSetResource/10/10        66568 ns        66565 ns         9212
bmSetResource/10/100      668162 ns       668139 ns          927
bmSetResource/100/100   11704205 ns     11703982 ns           66
bmGetResource/1/1           11.1 ns         11.1 ns     64584407
bmGetResource/1/10          11.1 ns         11.1 ns     64811719
bmGetResource/10/10         12.3 ns         12.3 ns     61295787
bmGetResource/10/100        11.7 ns         11.7 ns     65544985
bmGetResource/100/100       11.1 ns         11.1 ns     63082759

After:

Run on (12 X 4500 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x6)
  L1 Instruction 32 KiB (x6)
  L2 Unified 1024 KiB (x6)
  L3 Unified 8448 KiB (x1)
Load Average: 4.67, 3.54, 2.93
***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead.
***WARNING*** ASLR is enabled, the results may have unreproducible noise in them.
----------------------------------------------------------------
Benchmark                      Time             CPU   Iterations
----------------------------------------------------------------
bmSetResource/1/1            567 ns          566 ns       962403
bmSetResource/1/10          4322 ns         4322 ns       182713
bmSetResource/10/10        39329 ns        39327 ns        13611
bmSetResource/10/100      354231 ns       354193 ns         1790
bmSetResource/100/100    4878330 ns      4877578 ns          121
bmGetResource/1/1           18.3 ns         18.3 ns     32174377
bmGetResource/1/10          14.5 ns         14.5 ns     47773715
bmGetResource/10/10         15.7 ns         15.7 ns     50116376
bmGetResource/10/100        15.1 ns         15.1 ns     57349215
bmGetResource/100/100       14.3 ns         14.3 ns     38563010

Commit Message:
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:

birenroy added 2 commits July 1, 2026 13:53
…fer messages.

Signed-off-by: Biren Roy <birenroy@google.com>
Signed-off-by: Biren Roy <birenroy@google.com>
@repokitteh-read-only

Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #45924 was opened by birenroy.

see: more, trace.

@birenroy birenroy marked this pull request as ready for review July 1, 2026 19:09
@birenroy

birenroy commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

/assign @paul-r-gall

birenroy added 2 commits July 1, 2026 15:30
Signed-off-by: Biren Roy <birenroy@google.com>
Signed-off-by: Biren Roy <birenroy@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants