Yiling-J / theine-go

high performance in-memory cache
MIT License
273 stars 17 forks source link

optimize loading cache singleflight, reuse call #18

Closed Yiling-J closed 1 year ago

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01 :tada:

Comparison is base (37bff12) 95.72% compared to head (1e8eeeb) 95.73%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #18 +/- ## ========================================== + Coverage 95.72% 95.73% +0.01% ========================================== Files 12 12 Lines 1215 1196 -19 ========================================== - Hits 1163 1145 -18 + Misses 36 35 -1 Partials 16 16 ``` | [Impacted Files](https://app.codecov.io/gh/Yiling-J/theine-go/pull/18?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yiling-J) | Coverage Δ | | |---|---|---| | [internal/singleflight.go](https://app.codecov.io/gh/Yiling-J/theine-go/pull/18?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yiling-J#diff-aW50ZXJuYWwvc2luZ2xlZmxpZ2h0Lmdv) | `94.38% <100.00%> (-2.87%)` | :arrow_down: | | [internal/store.go](https://app.codecov.io/gh/Yiling-J/theine-go/pull/18?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yiling-J#diff-aW50ZXJuYWwvc3RvcmUuZ28=) | `98.46% <100.00%> (+<0.01%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/Yiling-J/theine-go/pull/18/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Yiling-J)

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

Yiling-J commented 1 year ago

before:

goos: darwin
goarch: amd64
pkg: github.com/Yiling-J/theine-go/internal
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkDo-12           4437208               272.7 ns/op            79 B/op          0 allocs/op

after:

goos: darwin
goarch: amd64
pkg: github.com/Yiling-J/theine-go/internal
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
BenchmarkDo-12           4949822               242.0 ns/op             0 B/op          0 allocs/op