al8n / stretto

Stretto is a Rust implementation for Dgraph's ristretto (https://github.com/dgraph-io/ristretto). A high performance memory-bound Rust cache.
Apache License 2.0
413 stars 28 forks source link

Copying of all fields of Self is replaced with modification of only modifying field of interest #52

Closed peter-scholtens closed 1 year ago

peter-scholtens commented 1 year ago

Copying a struct with 14 usize fields will require 47 assembly instruction while modifying Self only takes 9. Also the code readability is improved.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 86.36% and project coverage change: +0.73 :tada:

Comparison is base (e89d308) 83.91% compared to head (7e03b66) 84.65%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #52 +/- ## ========================================== + Coverage 83.91% 84.65% +0.73% ========================================== Files 17 17 Lines 1921 1844 -77 ========================================== - Hits 1612 1561 -51 + Misses 309 283 -26 ``` | [Impacted Files](https://app.codecov.io/gh/al8n/stretto/pull/52?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Al+Liu) | Coverage Δ | | |---|---|---| | [src/cache/builder.rs](https://app.codecov.io/gh/al8n/stretto/pull/52?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Al+Liu#diff-c3JjL2NhY2hlL2J1aWxkZXIucnM=) | `86.36% <85.71%> (+8.28%)` | :arrow_up: | | [src/bbloom.rs](https://app.codecov.io/gh/al8n/stretto/pull/52?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Al+Liu#diff-c3JjL2JibG9vbS5ycw==) | `100.00% <100.00%> (ø)` | | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/al8n/stretto/pull/52/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Al+Liu)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.