SymbolLookup.libraryLookup() is quite slow on MacOS with M-series chips

Sebastian Stenzel sebastian.stenzel at gmail.com
Fri May 26 18:22:08 UTC 2023


Is it reproducible? Maybe your openssl .dylib is x86_64 and Rosetta kicked in on first use?

> Am 26.05.2023 um 18:21 schrieb Maurizio Cimadamore <maurizio.cimadamore at oracle.com>:
> 
> 
>> On 26/05/2023 16:51, 刘希晨 wrote:
>> I noticed a weird problem about SymbolLookup.libraryLookup() with SegmentScope.global when I was testing on my M1-pro macbook using JDK20, the method took about 700ms to finish when loading OpenSSL's dynamic library, this result is quite slow. I tested on Windows and Linux(using WSL on Windows) with older hardware (AMD Ryzen 3700x) and it takes around 100ms. Please run some tests about this situation and correct me if I am wrong. Thanks for your help!
> Hi,
> 
> this seems very odd, we will look into it.
> 
> Note that SymbolLookup::libraryLookup just ends up straight into a dlopen call. There are not many strings attached, really. 700ms (but even 100ms) seems quite a lot to me.
> 
> Can you also try with System::loadLibrary - is it faster that way (I very much doubt it, since the underlying code is the same?)
> 
> Cheers
> Maurizio
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2491 bytes
Desc: not available
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20230526/e86adb74/smime-0001.p7s>


More information about the panama-dev mailing list