Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

make unit test run un-slow again. #239

Merged
merged 2 commits into from
Oct 16, 2024
Merged

Conversation

CyonAlexRDX
Copy link
Contributor

@CyonAlexRDX CyonAlexRDX commented Oct 16, 2024

Note

Target branch is not main, rather Ghenadies UniFFI branch
We really want this change on main too, but we expect to merge the UniFFI sep branch soon

Make unit test run in 80% faster (On my Mac Studio, now rung in 40s instead of 75 sec).

The slow test run in 1.3 sec instead of 5.3 sec.

The culprit was the manual look up in sample_associated_mnemonic using if == comparision, instead of using a map structure.

I profiled using flamegraph which is a great tool. It is a bit hard at first to understand. It is the width of the rows which matter, not the color nor does any horizintal position matter.
Screenshot 2024-10-16 at 13 14 41

See flramegraph file - this is run before this optimization
flamegraph

You need to boot your mac in Recovery Mode and disable SIP for dtrace to get flamegraph to work - follow this answer if you wanna try it yourself: https://stackoverflow.com/a/33584192

Copy link

codecov bot commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.3%. Comparing base (31ea06f) to head (be82eb3).
Report is 1 commits behind head on uniffi_separation.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##           uniffi_separation    #239   +/-   ##
=================================================
  Coverage               94.2%   94.3%           
=================================================
  Files                    868     868           
  Lines                  15496   15497    +1     
  Branches                  72      72           
=================================================
+ Hits                   14611   14614    +3     
+ Misses                   871     869    -2     
  Partials                  14      14           
Flag Coverage Δ
rust 93.0% <100.0%> (+<0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...rc/types/samples/factor_source_ids_with_samples.rs 100.0% <100.0%> (+5.0%) ⬆️

@CyonAlexRDX CyonAlexRDX merged commit 18c099d into uniffi_separation Oct 16, 2024
4 of 12 checks passed
@CyonAlexRDX CyonAlexRDX deleted the faster_unit_tests branch October 16, 2024 11:40
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.

3 participants