-
Notifications
You must be signed in to change notification settings - Fork 247
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
Darren/feat/add subscription cache #866
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #866 +/- ##
==========================================
- Coverage 62.63% 60.57% -2.06%
==========================================
Files 209 210 +1
Lines 18952 22498 +3546
==========================================
+ Hits 11870 13628 +1758
- Misses 5982 7760 +1778
- Partials 1100 1110 +10 ☔ View full report in Codecov by Sentry. |
cacheSize = 1 | ||
} | ||
cache, err := lru.New(int(cacheSize)) | ||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Can we handle this more gracefully? Currently subscriptions.New
nor api.New
return errors, so this would mess up the flow a little bit
Description
This PR leverages an LRU cache for
beat
,beat2
andblock
subscription endpoints. It generates the messages, marshals them and caches the bytes against thor block ID.This improves CPU performance a lot when:
How Has This Been Tested?
Checklist: