Comments (6)
Thanks for the info @ben-manes. Given that information, would you say that it's better to keep the current implementation as-is?
from guava.
This is already addressed by the JDK team’s EA build. That’ll avoid surprises as a better long term solution.
from guava.
That's cool to see and would definitely help long term, but unfortunately my company only uses LTS versions of Java so that'd mean we'd have to wait until Java 25 (or whatever it is) to be released.
from guava.
If you read the thread, you’ll see that VTs still have serious problems and must be used very carefully for now. You might not want to use them until 25 when hopefully they’ll be less error prone. Libraries trying to support them early might not really help; imho it’s best to wait.
the summary here is that addressing the issue with object
monitors pinning is great but the hoorays may be short lived as the spot
light moves to other cases where carriers are pinned, and specifically
native frames due to resolving references to classes in the constant
pool and the resulting class loading, or class initializers. There are
some ideas around this that may provide some relief on these cases. We
had to shake out issues with object monitors first.
from guava.
+1, thanks.
One other note: We did a little work to improve the memory usage of Suppliers.memoize
recently. I would suspect that a switch to ReentrantLock
would more than undo the gains from that. And the reason that we did the optimization is that it appeared to matter at least a little to our fleet in aggregate, so I'd expect a switch to ReentrantLock
hurt in a small but measurable way.
There is probably a way to write our own even more efficient implementation of Suppliers.memoize
, which would use LockSupport.park
and friends directly. (I'd played around with something similar for Dagger in my internal cl/209143332, as has another developer in cl/448147583.) That could not only be more compact but also avoid making waiters take turns in receiving the produced value. It hasn't been clearly worth the effort, but it's possible that virtual threads will change the calculus.
Whatever we decide for now, it's possible that we'll revisit as we get more experience with virtual threads. (If we encounter the level of problems that Ben Manes passes along, then we may not get that experience anytime soon :))
from guava.
Oh, also: As the Java platform develops more broadly, we may also see alternatives to Suppliers.memoize
become available there, reducing the need for Guava's version. See, for example, https://openjdk.org/jeps/8312611 or even https://openjdk.org/jeps/8209964.
from guava.
Related Issues (20)
- Add action version comments in GitHub workflow files HOT 1
- Supply Chain Security
- Is `com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava` really necessary? HOT 2
- SmoothRateLimiter.SmoothBursty obtaining too many permits without failure HOT 1
- Certain versions of Guava on Maven central no longer working on Java 11 HOT 2
- guava-gwt should publish Gradle module metadata or somehow fix POM HOT 2
- java.lang.NoSuchMethodError: 'void com.google.common.base.Preconditions.checkState(boolean, java.lang.String, long) HOT 1
- Copying a filtered collection with ImmutableSet.copyOf() should require visiting each element only once HOT 1
- com.google.common.collect.Range#hasLowerBound determination error after deserialization HOT 7
- InternetDomainName.topPrivateDomain() throws exception for Amazonaws-Domain HOT 4
- Use Gradle module available-at tag instead of files for redirecting jre vs android consumers HOT 5
- Failing while building guava version v31.0.1 using mvn clean install HOT 3
- Make `Striped.custom` public HOT 2
- Improve `guava-android` Animal Sniffer compatibility testing for Java 8+ APIs
- 2024年, 一元机场是不是跑路了? HOT 1
- Add Duration support for CacheBuilder.expireAfterWrite like in other guava projects HOT 4
- class file for com.google.errorprone.annotations.CompatibleWith not found HOT 3
- Use GitHub Actions for most release automation
- RateLimiter.tryAcquire blocks when it should not HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from guava.