Re: RFR: JDK-8286666: JEP 429: Implementation of Scoped Values (Incubator) [v14]

2022-11-18 Thread Andrew Haley
On Wed, 16 Nov 2022 19:04:29 GMT, Andrew Haley  wrote:

>> Probably so, yes. I'll have a look at that along with caching failure.
>
> So I just did the experiment of caching failures and the result of 
> `isBound()`.
> 
> This test:
> 
> 
> @Benchmark
> @OutputTimeUnit(TimeUnit.NANOSECONDS)
> public int thousandMaybeGets(Blackhole bh) throws Exception {
> int result = 0;
> for (int i = 0; i < 1_000; i++) {
> if (ScopedValuesData.sl1.isBound()) {
> result += ScopedValuesData.sl1.get();
> }
> }
> return result;
> }
> 
> 
> 
> Before and after:
> 
> 
> ScopedValues.thousandMaybeGets   avgt   10  13436.112 ± 20.885  ns/op
> ScopedValues.thousandMaybeGets   avgt   10 56.315 ± 0.583  ns/op
> 
> 
> You may have a point. The experiment is on a branch  called 
> `JDK-828-cache-queries` in [My personal 
> repo](https://github.com/theRealAph/jdk).
> 
> I'd push it now but it's getting a bit late to make such changes now. WDYT?

Fixed.

-

PR: https://git.openjdk.org/jdk/pull/10952


Re: RFR: JDK-8286666: JEP 429: Implementation of Scoped Values (Incubator) [v14]

2022-11-18 Thread Andrew Haley
> JEP 429 implementation.

Andrew Haley has updated the pull request incrementally with two additional 
commits since the last revision:

 - Merge branch 'JDK-828' of https://github.com/theRealAph/jdk into 
JDK-828
 - Reviewer feedback

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/10952/files
  - new: https://git.openjdk.org/jdk/pull/10952/files/cac85ad0..6de9a4cc

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=10952&range=13
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10952&range=12-13

  Stats: 27 lines in 2 files changed: 9 ins; 13 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/10952.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10952/head:pull/10952

PR: https://git.openjdk.org/jdk/pull/10952