keith-turner commented on code in PR #4568:
URL: https://github.com/apache/accumulo/pull/4568#discussion_r1605097414


##########
core/src/main/java/org/apache/accumulo/core/metadata/schema/TabletMetadata.java:
##########
@@ -156,8 +156,13 @@ private TabletMetadata(Builder tmBuilder) {
     this.compacted = tmBuilder.compacted.build();
     this.userCompactionsRequested = tmBuilder.userCompactionsRequested.build();
     this.unSplittableMetadata = tmBuilder.unSplittableMetadata;
-    this.fileSize =
-        Suppliers.memoize(() -> 
files.values().stream().mapToLong(DataFileValue::getSize).sum());
+    this.fileSize = Suppliers.memoize(() -> {

Review Comment:
   Not exactly sure why streams are so much slower, its probably the long call 
stack and object allocation as the stream works through each item that 
@dlmarion mentioned.  Realizing its probably best to avoid streams for cases 
where code is called really frequently.  We saw this in accumulo-access where 
we have a jhm performance benchmark test, replacing a stream with a for loop 
caused a massive increase in performance for code that was executed per 
expression.  Was a bit surprised at the difference that small change made in 
performance for accumulo-access.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to