• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

go-pkgz / expirable-cache / 14459642506
100%

Build:
DEFAULT BRANCH: master
Ran 15 Apr 2025 02:03AM UTC
Jobs 1
Files 2
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

15 Apr 2025 02:03AM UTC coverage: 100.0%. Remained the same
14459642506

push

github

web-flow
Optimize core cache operations for performance, Go 1.24 (#18)

* Optimize core cache operations for performance, Go 1.24

Improve performance in frequently used cache methods:

1. Values method:
   - Move time.Now() outside of lock
   - Simplify iteration

2. DeleteExpired method:
   - Replace key slice allocation with direct list traversal
   - Cache time.Now() call for efficiency, move out of lock
   - Avoid redundant map lookups
   - Properly handle list traversal during element removal

3. Add method:
   - Cache time.Now() and move out of lock

All optimizations preserve API compatibility while reducing allocations and CPU work.

Signed-off-by: Mathias Bogaert <mathias.bogaert@gmail.com>

* Remove unused method.

Signed-off-by: Mathias Bogaert <mathias.bogaert@gmail.com>

* Downgrade go requirement for v3 back to 1.20

* Apply performance optimizations to v1 and v2 versions

- Move ttl check and time.Now() outside lock to reduce lock contention
- Optimize DeleteExpired with direct list traversal
- Remove unused removeOldestIfExpired method
- Use same inline expiration check

* Update benchmark results in README files

- Update benchmark results in main README with latest performance metrics
- Update benchmarks README with current numbers
- Adjust performance improvement percentages to reflect latest changes

---------

Signed-off-by: Mathias Bogaert <mathias.bogaert@gmail.com>
Co-authored-by: Dmitry Verkhoturov <paskal.07@gmail.com>

13 of 13 new or added lines in 1 file covered. (100.0%)

168 of 168 relevant lines covered (100.0%)

137.08 hits per line

Jobs
ID Job ID Ran Files Coverage
1 14459642506.1 15 Apr 2025 02:03AM UTC 2
100.0
GitHub Action Run
Source Files on build 14459642506
  • Tree
  • List 2
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • c006c003 on github
  • Prev Build on master (#13825013328)
  • Next Build on master (#19903535062)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc