Skip to content

Conversation

@musicinmybrain
Copy link

@musicinmybrain musicinmybrain commented Mar 13, 2025

Update itertools, strsim, owo-colors, strum, hashbrown, and line-numbers to current releases. In all cases, the upstream changelog is linked in the commit message (except owo-colors where none is available), I inspected the source for obvious issues, and I confirmed that cargo test still works.

I did not touch unicode-width or any of the tree-sitter crates because I suspected that those updates might require more careful validation.

@Wilfred
Copy link
Owner

Wilfred commented Aug 16, 2025

Thanks for the PR! This mostly looks good if you want to rebase.

My only concern is the hashbrown change, because difftastic is extremely sensitive to hash performance. Could you confirm that performance is the same (see the perf commands in this manual), or drop that change for now?

@musicinmybrain
Copy link
Author

I rebased (well, reimplemented) this PR:

  • itertools is no longer a direct dependency, only via assert_cmdpredicatesitertools, so we don’t need to update it anymore
  • updating strsim aligns the direct and indirect dependencies so that Cargo.lock now only contains one strsim version, which is nice

I’ll attempt a benchmark next.

@musicinmybrain
Copy link
Author

Working on Fedora Asahi Remix on an M2 laptop, with current master b5a4df1:

$ perf stat ./target/release/difft sample_files/slow_1.rs sample_files/slow_2.rs
[…]
 Performance counter stats for './target/release/difft sample_files/slow_1.rs sample_files/slow_2.rs':

            409.95 msec task-clock:u                     #    0.951 CPUs utilized             
                 0      context-switches:u               #    0.000 /sec                      
                 0      cpu-migrations:u                 #    0.000 /sec                      
            22,249      page-faults:u                    #   54.272 K/sec                     
     2,183,271,959      apple_avalanche_pmu/instructions/u #    1.78  insn per cycle            
     <not counted>      apple_blizzard_pmu/instructions/u                                        (0.00%)
     1,223,695,079      apple_avalanche_pmu/cycles/u     #    2.985 GHz                       
     <not counted>      apple_blizzard_pmu/cycles/u                                             (0.00%)
       366,687,856      apple_avalanche_pmu/branches/u   #  894.469 M/sec                     
     <not counted>      apple_blizzard_pmu/branches/u                                           (0.00%)
        10,797,031      apple_avalanche_pmu/branch-misses/u #    2.94% of all branches           
     <not counted>      apple_blizzard_pmu/branch-misses/u                                        (0.00%)

       0.431225041 seconds time elapsed

       0.382472000 seconds user
       0.025935000 seconds sys

…and with this PR,

$ perf stat ./target/release/difft sample_files/slow_1.rs sample_files/slow_2.rs
[…]
 Performance counter stats for './target/release/difft sample_files/slow_1.rs sample_files/slow_2.rs':

            403.80 msec task-clock:u                     #    0.998 CPUs utilized             
                 0      context-switches:u               #    0.000 /sec                      
                 0      cpu-migrations:u                 #    0.000 /sec                      
            22,250      page-faults:u                    #   55.101 K/sec                     
     2,215,306,327      apple_avalanche_pmu/instructions/u #    1.82  insn per cycle            
     <not counted>      apple_blizzard_pmu/instructions/u                                        (0.00%)
     1,214,404,391      apple_avalanche_pmu/cycles/u     #    3.007 GHz                       
     <not counted>      apple_blizzard_pmu/cycles/u                                             (0.00%)
       370,537,618      apple_avalanche_pmu/branches/u   #  917.623 M/sec                     
     <not counted>      apple_blizzard_pmu/branches/u                                           (0.00%)
        10,732,840      apple_avalanche_pmu/branch-misses/u #    2.90% of all branches           
     <not counted>      apple_blizzard_pmu/branch-misses/u                                        (0.00%)

       0.404490064 seconds time elapsed

       0.382549000 seconds user
       0.019902000 seconds sys

I don’t see anything concerning there, but please let me know if there’s something else you would like me to try.

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.

2 participants