-
Notifications
You must be signed in to change notification settings - Fork 122
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
Cache revision tree bytes for history call #1097
Conversation
|
try { | ||
return delegate.open(objectId0, typeHint); | ||
} catch (IOException e) { | ||
throw new RuntimeException("failed to open an object: " + objectId0, e); |
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.
nit:
throw new RuntimeException("failed to open an object: " + objectId0, e); | |
throw new UncheckedIOException("failed to open an object: " + objectId0, e); |
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.
Fixed. 😉
private static final Logger logger = LoggerFactory.getLogger(CachingTreeObjectReader.class); | ||
|
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.
nit: unused.
private static final Logger logger = LoggerFactory.getLogger(CachingTreeObjectReader.class); |
...om/linecorp/centraldogma/server/internal/storage/repository/git/CachingTreeObjectReader.java
Show resolved
Hide resolved
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.
👍👍
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1097 +/- ##
============================================
- Coverage 70.29% 70.07% -0.22%
- Complexity 4284 4388 +104
============================================
Files 427 443 +16
Lines 17258 17700 +442
Branches 1915 1946 +31
============================================
+ Hits 12131 12404 +273
- Misses 4077 4245 +168
- Partials 1050 1051 +1 ☔ View full report in Codecov by Sentry. |
Thanks for reviewing. 😉 |
Motivation:
The history call is resource-intensive, consuming significant CPU and memory when it cannot locate the requested content in a single call.
By caching revision trees, we can optimize resource usage.
Modifications:
CachingTreeObjectReader
to cache revision trees and reduce redundant computations.Result: