<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Cool benchmark/test case!</p>
<p>I don't know off-hand where the difference could be coming from -
but just curious: did you try accessing in a loop (e.g. to see if
checks are hoisted as expected) ?</p>
<p>I seem to recall that the lambda forms for guards-with-test are
rather complex, as they need to profile the various branches. I
wonder if some "leftover" from the profiling code stays there and
pollutes the benchmark?</p>
<p>Maurizio<br>
</p>
<div class="moz-cite-prefix">On 24/04/2024 07:37, Remi Forax wrote:<br>
</div>
<blockquote type="cite" cite="mid:144453100.12179950.1713940662054.JavaMail.zimbra@univ-eiffel.fr">
<pre>I get
Benchmark Mode Cnt Score Error Units
ReproducerBenchmarks.control avgt 5 1.250 ± 0.024 ns/op
ReproducerBenchmarks.gwt2_methodhandle avgt 5 1.852 ± 0.024 ns/op
and I don't understand why there is a difference in performance because
for c2, the strings "x" and "y" are constant so the corresponding
VarHandles should be constant thus optimized the same way.</pre>
</blockquote>
</body>
</html>