Skip to content

linter: improve the performance of phf_set for small datasets. #10076

@shulaoda

Description

@shulaoda

Repo: https://github.com/shulaoda/rust-benchmark-test
Benchmark: https://codspeed.io/shulaoda/rust-benchmark-test

On lower-end processors, the performance of phf_set is significantly worse than array. On my CPU (13th Gen Intel(R) Core(TM) i5-13600KF), the worst-case performance difference between the two is minimal, but in the best-case scenario, phf_set performs significantly worse than array.

PS: The data size is 25

------2025.04.20------

I’ve updated the repo — it now automatically generates the most frequent case and theoretical worst case for more precise and reliable optimization. Feel free to clone it, tweak the basic dataset, and run cargo bench --bench basic to try it out!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Priority

None yet

Start date

None yet

Target date

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions