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
Optimize IndexedTable #7373
Optimize IndexedTable #7373
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7373 +/- ##
============================================
- Coverage 71.65% 69.46% -2.20%
+ Complexity 3311 3217 -94
============================================
Files 1515 1121 -394
Lines 75006 52894 -22112
Branches 10910 7955 -2955
============================================
- Hits 53749 36745 -17004
+ Misses 17628 13534 -4094
+ Partials 3629 2615 -1014
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
} else { | ||
// Fewer records to retain than evict, make PQ of records to retain | ||
Comparator<IntermediateRecord> comparator = _intermediateRecordComparator.reversed(); | ||
PriorityQueue<IntermediateRecord> priorityQueue = convertToIntermediateRecordsPQ(recordsMap, size, comparator); |
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.
PriorityQueue<IntermediateRecord> priorityQueue = convertToIntermediateRecordsPQ(recordsMap, size, _intermediateRecordComparator.reversed());
protected void resize() { | ||
long startTimeMs = System.currentTimeMillis(); | ||
_tableResizer.resizeRecordsMap(_lookupMap, _trimSize); | ||
long resizeTimeMs = System.currentTimeMillis() - startTimeMs; |
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.
This clock is subject to adjustments, so can jump forwards and backwards. For relative time measurement of synchronous code, System.nanoTime() is the right clock to use.
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.
Good point. Changed to use ns to track the resize time
f223162
to
0e7dac0
Compare
IndexedTable
Observes less GC and lower memory usage:
Before:
After: