Skip to content

chore: EXC: Pseudo-random embedders heap benchmarks results with THP changes #4795

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

berestovskyy
Copy link
Contributor

@berestovskyy berestovskyy commented Apr 11, 2025

This PR runs pseudo-random heap benchmarks with 2 MiB, 5 MiB and 500 MiB steps on thp branch. There were 9 regressions detected, mostly query new_allocation writes. The top regression is from ~7 ms to ~130 ms:

= 084e832e61..084e832e61: Embedders Heap total time: 1428 ms (regressed by 720.8 ms / 101.8%)
  Top 10 by time:
  + embedders:heap/query/wasm32_query_write_fwd_1gb_step_2mb_new_allocation time regressed by 131.1 ms (1666.3%)
  + embedders:heap/query/wasm64_query_write_fwd_1gb_step_2mb_new_allocation time regressed by 130.9 ms (1665.8%)
  + embedders:heap/query/wasm32_query_write_bwd_1gb_step_2mb_new_allocation time regressed by 130.6 ms (1725.5%)
  + embedders:heap/query/wasm64_query_write_bwd_1gb_step_2mb_new_allocation time regressed by 129.6 ms (1684.4%)
  + embedders:heap/query/wasm32_query_write_bwd_1gb_step_5mb_new_allocation time regressed by 54.5 ms (1738.0%)
  + embedders:heap/query/wasm32_query_write_fwd_1gb_step_5mb_new_allocation time regressed by 54.2 ms (1708.6%)
  + embedders:heap/query/wasm64_query_write_fwd_1gb_step_5mb_new_allocation time regressed by 53.9 ms (1712.7%)
  + embedders:heap/query/wasm64_query_write_bwd_1gb_step_5mb_new_allocation time regressed by 53.8 ms (1735.2%)
  + embedders:heap/update/wasm32_update_write_bwd_1gb_step_2mb_checkpoint time regressed by 1.5 ms (8.0%)
  - embedders:heap/query/wasm32_query_write_bwd_1gb_step_2mb_checkpoint time improved by -3.5 ms (-39.9%)
  - embedders:heap/query/wasm64_query_write_bwd_1gb_step_2mb_checkpoint time improved by -3.4 ms (-38.7%)
  - embedders:heap/query/wasm64_query_read_bwd_1gb_step_2mb_checkpoint time improved by -3.2 ms (-28.6%)
  - embedders:heap/query/wasm32_query_read_bwd_1gb_step_2mb_checkpoint time improved by -3.0 ms (-27.4%)
  - embedders:heap/query/wasm32_query_read_bwd_1gb_step_2mb_new_allocation time improved by -2.6 ms (-39.9%)
  - embedders:heap/query/wasm64_query_read_bwd_1gb_step_2mb_new_allocation time improved by -2.6 ms (-40.3%)
  - embedders:heap/update/wasm64_update_read_bwd_1gb_step_2mb_checkpoint time improved by -2.4 ms (-27.4%)
  - embedders:heap/update/wasm32_update_read_bwd_1gb_step_2mb_checkpoint time improved by -2.4 ms (-28.1%)
  - embedders:heap/update/wasm64_update_read_bwd_1gb_step_2mb_new_allocation time improved by -2.2 ms (-35.9%)
  - embedders:heap/update/wasm32_update_read_bwd_1gb_step_2mb_new_allocation time improved by -2.1 ms (-34.5%)

See details in 7dbe49b36a.log and root EMBEDDERS_HEAP.min.

The transparent huge pages improve host memory performance, resulting in a ~30% improvement across benchmarks without regressions. Some benchmarks (like `query_write_bwd_1gb_step_8_page_delta`) reduce their runtime by more than 700 ms (more than 60% of the runtime). Some benchmarks (like `query_read_bwd_1gb_step_4kb_new_allocation`) are improved by more than 90% from 226 ms down to 7 ms.

```
= 5d40b0f..4b15a2867f: Embedders Heap total time: 96426 ms (improved by -43022.6 ms / -30.9%)
  Top 10 by time:
  - query/wasm32_query_write_bwd_1gb_step_8_page_delta time improved by -729.9 ms (-63.1%)
  - query/wasm32_query_read_bwd_1gb_step_8_page_delta time improved by -729.0 ms (-63.8%)
  - query/wasm64_query_read_fwd_1gb_step_8_page_delta time improved by -728.8 ms (-63.0%)
  - query/wasm64_query_read_bwd_1gb_step_4kb_page_delta time improved by -725.2 ms (-70.9%)
  - query/wasm32_query_write_fwd_1gb_step_4kb_page_delta time improved by -724.0 ms (-70.8%)
  - query/wasm32_query_write_bwd_1gb_step_4kb_page_delta time improved by -721.7 ms (-70.7%)
  - query/wasm32_query_read_bwd_1gb_step_4kb_page_delta time improved by -718.4 ms (-70.5%)
  - query/wasm64_query_read_bwd_1gb_step_8_page_delta time improved by -717.2 ms (-62.3%)
  - query/wasm32_query_read_fwd_1gb_step_8_page_delta time improved by -716.7 ms (-63.4%)
  - query/wasm64_query_write_fwd_1gb_step_4kb_page_delta time improved by -709.9 ms (-70.4%)
  Top 10 by percentage:
  - update/wasm64_update_read_bwd_1gb_step_4kb_new_allocation time improved by -96.9% (-219.4 ms)
  - query/wasm64_query_read_bwd_1gb_step_4kb_new_allocation time improved by -96.9% (-220.5 ms)
  - query/wasm64_query_read_fwd_1gb_step_4kb_new_allocation time improved by -96.9% (-221.0 ms)
  - update/wasm64_update_read_fwd_1gb_step_4kb_new_allocation time improved by -96.8% (-219.1 ms)
  - update/wasm32_update_read_fwd_1gb_step_4kb_new_allocation time improved by -96.7% (-219.0 ms)
  - update/wasm32_update_read_bwd_1gb_step_4kb_new_allocation time improved by -96.7% (-219.5 ms)
  - query/wasm32_query_read_bwd_1gb_step_4kb_new_allocation time improved by -96.7% (-219.9 ms)
  - query/wasm32_query_read_fwd_1gb_step_4kb_new_allocation time improved by -96.7% (-222.5 ms)
  - update/wasm64_update_read_bwd_1gb_step_16kb_new_allocation time improved by -91.7% (-66.2 ms)
  - update/wasm32_update_read_bwd_1gb_step_16kb_new_allocation time improved by -91.6% (-66.6 ms)
```
@github-actions github-actions bot added the chore label Apr 11, 2025
For pseudo-random access, 9 benchmarks regressed, mostly `new_allocation`:
```
= 084e832..084e832: Embedders Heap total time: 1428 ms (regressed by 720.8 ms / 101.8%)
  Top 10 by time:
  + embedders:heap/query/wasm32_query_write_fwd_1gb_step_2mb_new_allocation time regressed by 131.1 ms (1666.3%)
  + embedders:heap/query/wasm64_query_write_fwd_1gb_step_2mb_new_allocation time regressed by 130.9 ms (1665.8%)
  + embedders:heap/query/wasm32_query_write_bwd_1gb_step_2mb_new_allocation time regressed by 130.6 ms (1725.5%)
  + embedders:heap/query/wasm64_query_write_bwd_1gb_step_2mb_new_allocation time regressed by 129.6 ms (1684.4%)
  + embedders:heap/query/wasm32_query_write_bwd_1gb_step_5mb_new_allocation time regressed by 54.5 ms (1738.0%)
  + embedders:heap/query/wasm32_query_write_fwd_1gb_step_5mb_new_allocation time regressed by 54.2 ms (1708.6%)
  + embedders:heap/query/wasm64_query_write_fwd_1gb_step_5mb_new_allocation time regressed by 53.9 ms (1712.7%)
  + embedders:heap/query/wasm64_query_write_bwd_1gb_step_5mb_new_allocation time regressed by 53.8 ms (1735.2%)
  + embedders:heap/update/wasm32_update_write_bwd_1gb_step_2mb_checkpoint time regressed by 1.5 ms (8.0%)
  - embedders:heap/query/wasm32_query_write_bwd_1gb_step_2mb_checkpoint time improved by -3.5 ms (-39.9%)
  - embedders:heap/query/wasm64_query_write_bwd_1gb_step_2mb_checkpoint time improved by -3.4 ms (-38.7%)
  - embedders:heap/query/wasm64_query_read_bwd_1gb_step_2mb_checkpoint time improved by -3.2 ms (-28.6%)
  - embedders:heap/query/wasm32_query_read_bwd_1gb_step_2mb_checkpoint time improved by -3.0 ms (-27.4%)
  - embedders:heap/query/wasm32_query_read_bwd_1gb_step_2mb_new_allocation time improved by -2.6 ms (-39.9%)
  - embedders:heap/query/wasm64_query_read_bwd_1gb_step_2mb_new_allocation time improved by -2.6 ms (-40.3%)
  - embedders:heap/update/wasm64_update_read_bwd_1gb_step_2mb_checkpoint time improved by -2.4 ms (-27.4%)
  - embedders:heap/update/wasm32_update_read_bwd_1gb_step_2mb_checkpoint time improved by -2.4 ms (-28.1%)
  - embedders:heap/update/wasm64_update_read_bwd_1gb_step_2mb_new_allocation time improved by -2.2 ms (-35.9%)
  - embedders:heap/update/wasm32_update_read_bwd_1gb_step_2mb_new_allocation time improved by -2.1 ms (-34.5%)
```

See `7dbe49b36a.log` for more details.
@berestovskyy berestovskyy force-pushed the andriy/exc-2012-random-benchmarks-thp branch from 076d8ca to 7966536 Compare April 12, 2025 10:37
@berestovskyy berestovskyy changed the title chore: EXC: Fixed "random" embedders heap benchmarks chore: EXC: Pseudo-random embedders heap benchmarks results with THP changes Apr 12, 2025
@berestovskyy
Copy link
Contributor Author

It's a draft PR is not supposed to be merged but just to run more benchmarks for the #4671 PR.

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