graph-revs-log-for-path: Optimize label name lookup
- .label_name() needs to bisect through a large file
- UTF-8 decoding takes a linear time in the file name size
- comparing strings is slower (also linear time) than comparing integers
This requires swh-graph >= 6.7.0, as it fixed a major soundness bug in label_name_id.
cc @anlambert
Merge request reports
Activity
requested review from @anlambert
Indeed the performance are much better, thanks !
Before:
$ time ./target/release/graph-revs-log-for-path ~/swh/graph_datasets/2024-08-23-popular-500-python/graph --start-rev-swhid swh:1:rev:3de092b82f5aa02fa293cd654c2ab26556ecf703 --path Modules > /dev/null [2025-03-10T14:44:25Z INFO graph_revs_log_for_path] Loading graph [2025-03-10T14:44:25Z INFO graph_revs_log_for_path] Graph loaded real 0m0,428s user 0m0,384s sys 0m0,044s
After:
$ time ./target/release/graph-revs-log-for-path ~/swh/graph_datasets/2024-08-23-popular-500-python/graph --start-rev-swhid swh:1:rev:3de092b82f5aa02fa293cd654c2ab26556ecf703 --path Modules > /dev/null [2025-03-10T14:45:44Z INFO graph_revs_log_for_path] Loading graph [2025-03-10T14:45:44Z INFO graph_revs_log_for_path] Graph loaded real 0m0,234s user 0m0,189s sys 0m0,044s
Could you also update the
Cargo.lock
file ?
Please register or sign in to reply