Skip to content
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

Add blob provider benchmark for auxiliary key fallback #4887

Merged
merged 4 commits into from May 11, 2024

Conversation

sffc
Copy link
Member

@sffc sffc commented May 10, 2024

To evaluate solutions for #2699

@sffc sffc requested a review from robertbastian May 10, 2024 18:04
@sffc sffc requested review from Manishearth and a team as code owners May 10, 2024 18:04
@sffc
Copy link
Member Author

sffc commented May 11, 2024

I added some #[inline(never)]s and ran pprof. Here's the weighted call tree for provider/auxkey/fallback/sr-ME-x-ym0d/v2

image

Reproduction instructions:

  1. Checkout https://github.com/sffc/omnicu/tree/archive/auxkey-bench-pprof
  2. From provider/blob, run cargo bench --all-features auxkey/fallback -- --profile-time 10
  3. Install pprof if you haven't already done so: go install github.com/google/pprof@latest
  4. Then open pprof like this: ~/go/bin/pprof -http=$hostname:12000 ../../target/release/deps/auxkey_bench-105bf790d34625b3 ../../target/criterion/provider_auxkey_fallback_sr-ME-x-ym0d_v2/profile/profile.pb

@sffc
Copy link
Member Author

sffc commented May 11, 2024

Summary of the main contributors to data loading performance, according to the pprof visualization:

  • 31% zerotrie reader function
  • 24% writeable impl walking the DataLocale struct
  • 20% fallback algorithm (step_language and run_fallback, which may include some data access)
  • 8% deserialization
  • 7% blob data access / indexing
  • 4% fallback data access (likely subtags ZeroMap2d)
  • 3% memcmp

Both of the top two contributors are things I've already spent quite a bit of time optimizing, which is good because they clearly have the most impact. However, there's always room for improvement.

@sffc sffc merged commit fbd61a3 into unicode-org:main May 11, 2024
30 checks passed
@sffc sffc deleted the auxkey-bench branch May 11, 2024 18:44
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.

None yet

2 participants