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

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Fri May 26 16:21:09 UTC 2023


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



More information about the panama-dev mailing list