[foreign-memaccess+abi] RFR: 8274592: Performance regression in upcalls

Jorn Vernee jvernee at openjdk.java.net
Thu Sep 30 14:14:03 UTC 2021


On Thu, 30 Sep 2021 13:49:33 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> Following the recent API refresh, I noticed that the QSort benchmark was broken (as it passed `MemoryAddress` where `Addressable` was expected). Upon fixing the benchmark, I realized that performance of upcalls dropped significantly (~3x).
> 
> After some investigation, I realized that we were using the default scope factory (which uses a cleaner!) inside some classes in the linker implementation.
> 
> The solution is to use the explicit factory which disables the cleaner, so as to avoid overhead.
> 
> There were similar issues in microbenchmarks; while using the default factory is fine for e.g. fields, using it for benchmark code is not great, as that skews the benchmark (because of the cleaner). So I replaced all usages of the default factories in the benchmark methods, except in places where we explicitly wanted to use them.

Marked as reviewed by jvernee (Committer).

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

PR: https://git.openjdk.java.net/panama-foreign/pull/588


More information about the panama-dev mailing list