<div dir="ltr">I've run my decryption benchmarks on Java with this patch, with excellent results.<div>The benchmarks reach the top speed right away, no long warm-up anymore. </div><div>Also, there is no need to split the operation into multiple updates, the doFinal works just fine.</div><div><br></div><div>Moreover, the maximal decryption throughput is actually higher than in Java11 after warm-up.</div><div><div>On one thread, I get 930MB/sec instead of 850MB/s.</div><div>On 8 threads, 350x8 instead of 230x8.</div></div><div><br></div><div>This capability will be important in the Spark/Parquet workloads.</div><div><br></div><div>Cheers, Gidon</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Nov 30, 2018 at 6:10 PM Andrew Haley <<a href="mailto:aph@redhat.com" target="_blank">aph@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 11/21/18 5:37 PM, Andrew Haley wrote:<br>
> On 11/15/18 10:42 AM, Gidon Gershinsky wrote:<br>
>> Having the decryption optimized in the HotSpot engine would be ideal.<br>
> <br>
> I agree with you. I did a few experiments, and it can take a very<br>
> long time for C2 compilation to kick in, especially because GCM is<br>
> glacially slow until the intrinsics are used.<br>
> <br>
> I think this would be a generally useful enhancement to HotSpot,<br>
> and I'm kicking around an experimental patch which adds the<br>
> intrinsics to c1 and the interpreter.<br>
<br>
There's a proof-of-concept patch at <a href="http://cr.openjdk.java.net/~aph/gctr/" rel="noreferrer" target="_blank">http://cr.openjdk.java.net/~aph/gctr/</a><br>
It's all rather hacky but it works.<br>
<br>
The patch is rather more complicated than I would have liked. We<br>
could simplify it somewhat by getting rid of the C1 intrinsic, and<br>
instead making C1 call the interpreter implementation.<br>
<br>
There also a jmh benchmark in that directory. Test results for 1Mb<br>
look like this:<br>
<br>
Interp:<br>
<br>
Benchmark  Â  Â  Â  Â  Â  Â  Mode  Cnt  Â  Â Score  Â Error  Units<br>
AESGCMUpdateAAD2.test  avgt  Â  5  1426.275 Â± 8.778  us/op<br>
<br>
C1:<br>
<br>
Benchmark  Â  Â  Â  Â  Â  Â  Mode  Cnt  Â  Â Score  Â Error  Units<br>
AESGCMUpdateAAD2.test  avgt  Â  5  1359.367 Â± 8.196  us/op<br>
<br>
C2:<br>
<br>
Benchmark  Â  Â  Â  Â  Â  Â  Mode  Cnt  Â  Â Score  Â  Error  Units<br>
AESGCMUpdateAAD2.test  avgt  Â  5  1333.863 Â± 18.385  us/op<br>
<br>
-- <br>
Andrew Haley<br>
Java Platform Lead Engineer<br>
Red Hat UK Ltd. <<a href="https://www.redhat.com" rel="noreferrer" target="_blank">https://www.redhat.com</a>><br>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671<br>
</blockquote></div>