Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improve function_abi_no_longer_unwind performance by reordering current, baseline #777

Merged
merged 1 commit into from
May 11, 2024

Conversation

jw013
Copy link
Contributor

@jw013 jw013 commented May 10, 2024

Partially addresses #767

Comparing 0.29.1 to 0.30.0, it seems likely the largest performance issue is due to a new lint introduced in 0.30.0, function_abi_no_longer_unwind, which took 5 hours on my machine to check the aws ec2 crate using the command from the issue report. I ran every c-s-c release from 0.25.0 to 0.28.0 as well and did not see any other performance issues.

     Parsing aws-sdk-ec2 v1.41.0 (current)
      Parsed [ 128.600s] (current)
     Parsing aws-sdk-ec2 v1.41.0 (baseline)
      Parsed [  87.512s] (baseline)
    Checking aws-sdk-ec2 v1.41.0 -> v1.41.0 (assume minor change)
    Starting 61 checks, 6 unnecessary on 4 threads
...
        PASS [17804.320s]       major        function_abi_no_longer_unwind
...
     Checked [17812.879s] 61 checks; 61 passed, 6 unnecessary
    Finished [18041.203s] aws-sdk-ec2

I am not very knowledgeable about ABI's but if I understood things correctly from a cursory investigation, the default "Rust" ABI (i.e. the most common kind) is considered unwind-able. After reordering the current and baseline branches of the query to look for non-unwind-able functions first, the function_abi_no_longer_unwind lint runs in under a second:

     Parsing aws-sdk-ec2 v1.41.0 (current)
             Features: behavior-version-latest,default,rt-tokio,rustls,test-util
      Parsed [ 144.442s] (current)
     Parsing aws-sdk-ec2 v1.41.0 (baseline)
             Features: behavior-version-latest,default,rt-tokio,rustls,test-util
      Parsed [ 102.323s] (baseline)
    Checking aws-sdk-ec2 v1.41.0 -> v1.41.0 (assume minor change)
    Starting 67 checks, 6 unnecessary on 4 threads
...
        PASS [   0.605s]       major        function_abi_no_longer_unwind
...
     Checked [  21.817s] 67 checks; 67 passed, 6 unnecessary
    Finished [ 285.853s] aws-sdk-ec2

@obi1kenobi
Copy link
Owner

Thanks for digging into this, I appreciate it! Great work!

I think I'd prefer to leave #767 open though, since this fix addresses the most obvious current problem, but the same issue could just immediately come back on the next lint.

I'll need to find some time to improve the overall query execution around ABIs and the other more complex lints we've started checking since the last performance pass I did. I'll unlink this PR from #767 to remind me.

@obi1kenobi obi1kenobi merged commit 99b045d into obi1kenobi:main May 11, 2024
34 checks passed
@jw013 jw013 deleted the fix-767 branch May 11, 2024 15:06
@obi1kenobi obi1kenobi mentioned this pull request Jun 17, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants