RFR: 8317538: Potential bottleneck in Provider::getService: specjvm2008::crypto.rsa have scalability issue for high vCPU numbers [v2]

Anthony Scarpino ascarpino at openjdk.org
Fri Nov 1 21:45:28 UTC 2024


On Tue, 29 Oct 2024 22:31:28 GMT, Vladimir Ivanov <vaivanov at openjdk.org> wrote:

>> This patch remove access to the shared variable to fix scalability issue in the multithread environment. According to testing by the specjvm2008::crypto.rsa the one thread performance reduced for less than 1% while the score for the multithread run increased in ~2x. For the 2 socket system with Xeon 8480+ numbers looks as:
>> •	1 thread: 643.15 for original version vs 642.54 for patched one;
>> •	224 threads: 22446.19 for original vs 46147.41 for patched.
>> The RSABench microbenchmark reports no score changes for the 1 thread (average for all testcases) and 2.4% improvement for the 224 threads.
>
> Vladimir Ivanov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8317538: Potential bottleneck in Provider::getService: specjvm2008::crypto.rsa have scalability issue for high vCPU numbers

src/java.base/share/classes/java/security/Provider.java line 1314:

> 1312:     // list and queries each provider with the same values until it finds
> 1313:     // a matching service
> 1314:     private transient ServiceKey previousKey =

`transient` is for serialization and I don't think this should affect performance here.  Have you tried just `private ServiceKey ...`?

src/java.base/share/classes/java/security/Provider.java line 1315:

> 1313:     // a matching service
> 1314:     private transient ServiceKey previousKey =
> 1315:                                             new ServiceKey("", "", false);

Please fix the formatting while you are making the change.  If a second line is still needed, it should be 4 whitespaces from the left margin.  The formatting was wrong before your change.  Thanks

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21719#discussion_r1826316363
PR Review Comment: https://git.openjdk.org/jdk/pull/21719#discussion_r1826317282


More information about the security-dev mailing list