lukecwik commented on a change in pull request #16495:
URL: https://github.com/apache/beam/pull/16495#discussion_r786378958
##########
File path:
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/Caches.java
##########
@@ -166,6 +165,10 @@ public int weigh(Object key, WeightedValue<Object> value) {
return (int) size;
}
})
+ // The maximum size of an entry in the cache is maxWeight
/ concurrencyLevel
+ // which is why we set the concurrency level to 1. See
+ // https://github.com/google/guava/issues/3462 for further
details.
+ .concurrencyLevel(1)
Review comment:
I have a benchmark that I've been meaning to push up after this change
that compared with and without cross bundle caching. I used it to check and it
looks like there is no noticeable difference.
With the concurrency level at the default (4):
```
Result
"org.apache.beam.fn.harness.jmh.ProcessBundleBenchmark.testStateWithCaching":
4452.734 ±(99.9%) 60.263 ops/s [Average]
(min, avg, max) = (4227.619, 4452.734, 4550.040), stdev = 80.449
CI (99.9%): [4392.471, 4512.997] (assumes normal distribution)
```
With the concurrent level at the 1:
```
Result
"org.apache.beam.fn.harness.jmh.ProcessBundleBenchmark.testStateWithCaching":
4445.516 ±(99.9%) 41.809 ops/s [Average]
(min, avg, max) = (4345.263, 4445.516, 4536.817), stdev = 55.814
CI (99.9%): [4403.707, 4487.325] (assumes normal distribution)
```
--
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]