Skip to content
Snippets Groups Projects

graph-revs-log-for-path: Optimize label name lookup

Merged vlorentz requested to merge path-parts into master
  • .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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • vlorentz requested review from @anlambert

    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 ?

  • Antoine Lambert approved this merge request

    approved this merge request

  • merged

Please register or sign in to reply
Loading