Skip to content

refactor!: optimize operations with multithreaded tokio #127

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

Merged
merged 24 commits into from
Apr 21, 2022
Merged

Conversation

Shadow53
Copy link
Owner

@Shadow53 Shadow53 commented Apr 21, 2022

Resolves #17.

This change includes a few large optimizations to help Hoard run faster:

  • CachedHoardItem: processes a system/hoard file pair once and caches the results for later usage
  • tokio: code was rewritten to use async/await with the multithreaded tokio runtime

Note: Windows now has to be tested in release mode.

This is most likely because of the giant match statement in src/hoard/iter/diff_files.rs. rust-lang/rust#34283 reports that, in debug mode, the stack usage of a match statement is the sum of all of the branches, while in release mode it is the amount of the largest branch only (if I understand right). Windows was experiencing stack overflows in CI, and this fixed it.

@Shadow53 Shadow53 added this to the 0.5.0 milestone Apr 21, 2022
@netlify
Copy link

netlify bot commented Apr 21, 2022

Deploy Preview for hoard-docs ready!

Name Link
🔨 Latest commit 063ec2d
🔍 Latest deploy log https://app.netlify.com/sites/hoard-docs/deploys/6261c264ffec7200089a4fae
😎 Deploy Preview https://deploy-preview-127--hoard-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@codecov
Copy link

codecov bot commented Apr 21, 2022

Codecov Report

Merging #127 (063ec2d) into main (74b6f00) will decrease coverage by 0.80%.
The diff coverage is 90.51%.

@@            Coverage Diff             @@
##             main     #127      +/-   ##
==========================================
- Coverage   92.22%   91.42%   -0.81%     
==========================================
  Files          74       71       -3     
  Lines        6176     6206      +30     
==========================================
- Hits         5696     5674      -22     
- Misses        480      532      +52     
Impacted Files Coverage Δ
src/checkers/history/operation/v1.rs 100.00% <ø> (+30.76%) ⬆️
src/command/edit.rs 0.00% <0.00%> (-95.00%) ⬇️
src/config/builder/environment/exe.rs 100.00% <ø> (ø)
src/config/builder/environment/mod.rs 100.00% <ø> (ø)
src/config/builder/environment/path.rs 100.00% <ø> (ø)
src/lib.rs 100.00% <ø> (ø)
src/main.rs 5.88% <0.00%> (ø)
src/test.rs 66.66% <ø> (ø)
tests/common/file.rs 0.00% <0.00%> (ø)
tests/common/toml.rs 0.00% <0.00%> (ø)
... and 67 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 74b6f00...063ec2d. Read the comment docs.

@Shadow53 Shadow53 merged commit b22879a into main Apr 21, 2022
@Shadow53 Shadow53 deleted the fs-optimization branch April 21, 2022 21:07
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.

Async/Multithreading
1 participant