On Mon, 7 Jul 2025 16:13:08 GMT, Andrew Haley <a...@openjdk.org> wrote:

> Neither `ScopedValue.orElse` nor `ScopedValue.orElseThrow` consult the cache 
> when searching for a binding. Neither do they update the cache when a binding 
> is found.
> While this issue does not affect spec compliance, it is surprising to users 
> that `x.orElse(other)` should be slower than `x.isBound ? x.get() : other`.

I've also added some more performance tests to ensure that `orElse()` really 
does consult the cache.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/26164#issuecomment-3045772935

Reply via email to