Skip to content

Use GetNumericProperty and shard limit_test. - #899

Draft
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_981778430
Draft

copybara-service[bot] wants to merge 1 commit into
masterfrom
test_981778430

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Sep 15, 2026

Copy link
Copy Markdown

Use GetNumericProperty and shard limit_test.

In limit_test (45.2s max duration in -c dbg):

  • Tests repeatedly invoke GetStats() and GetStatsInPbTxt() (allocating and formatting 3 MiB text and pbtxt buffers) and DumpHeapStats() on allocation milestones, performing expensive string formatting and regex matching.
  • LimitRespected allocates and frees 4 GiB in 16 KiB chunks (524,288 operations).

Replace GetStats() / GetStatsInPbTxt() string matching with MallocExtension::GetNumericProperty, remove DumpHeapStats(), set kLim to 1 GiB in LimitRespected (keeping all other test limits unchanged), and add shard_count = 11.

This reduces max shard execution time across all variants in -c dbg from 45.2s to 2.60s (< 5.0s) with 0 flakes across 300 runs (100/100 in -c dbg, -c fastbuild, and -c opt under blase --configs=none).

@copybara-service copybara-service Bot changed the title Optimize limit_test execution time across all allocator variants. Use GetNumericProperty and shard limit_test. Sep 17, 2026
@copybara-service
copybara-service Bot force-pushed the test_981778430 branch 8 times, most recently from e342f92 to dfcc793 Compare September 17, 2026 02:38
In `limit_test` (`45.2s` max duration in `-c dbg`):
- Tests repeatedly invoke `GetStats()` and `GetStatsInPbTxt()` (allocating and formatting 3 MiB text and pbtxt buffers) and `DumpHeapStats()` on allocation milestones, performing expensive string formatting and regex matching.
- `LimitRespected` allocates and frees 4 GiB in 16 KiB chunks (`524,288` operations).

Replace `GetStats()` / `GetStatsInPbTxt()` string matching with `MallocExtension::GetNumericProperty`, remove `DumpHeapStats()`, set `kLim` to 1 GiB in `LimitRespected` (keeping all other test limits unchanged), and add `shard_count = 11`.

This reduces max shard execution time across all variants in `-c dbg` from `45.2s` to `2.60s` (`< 5.0s`) with 0 flakes across 300 runs (`100/100` in `-c dbg`, `-c fastbuild`, and `-c opt` under `blase --configs=none`).

PiperOrigin-RevId: 981778430
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.

1 participant