Why libglInterpose.dylib loaded so slowly?

Total pre-main time: 980.70 milliseconds (100.0%)
dylib loading time: 23.06 milliseconds (2.3%)
rebase/binding time: 121.75 milliseconds (12.4%)
ObjC setup time: 76.00 milliseconds (7.7%)
initializer time: 759.73 milliseconds (77.4%)
slowest intializers :
libSystem.B.dylib : 16.47 milliseconds (1.6%)
libBacktraceRecording.dylib : 26.70 milliseconds (2.7%)
libglInterpose.dylib : 570.64 milliseconds (58.1%)
Camera360 : 208.81 milliseconds (21.2%)


When I use DYLD_PRINT_STATISTICS to measure startup time, The console show libglInterpose.dylib costs 570ms, Why?


Answered by DTS Engineer in 158373022

Interposing is a debugging technology and thus the cost to load interposing libraries is generally not considered relevant. I recommend you separate your graphics profiling work from your app launch time profiling work.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Accepted Answer

Interposing is a debugging technology and thus the cost to load interposing libraries is generally not considered relevant. I recommend you separate your graphics profiling work from your app launch time profiling work.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Do you means it's only happens for Debug model?

Do you means it's only happens for Debug model?

I’m not sure what you mean by “Debug model” but I will say that this library is part of Xcode’s debugging infrastructure. I’m not entirely sure what it does (I think it’s part of the OpenGL debugger, but OpenGL isn’t really my thing so I don’t know for sure) but it’s definitely part of Xcode:

$ find /Applications/Xcode.app -name libglInterpose.dylib

/Applications/Xcode.app/Contents/SharedFrameworks/GPUTools.framework/Versions/A/Resources/libglInterpose.dylib

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Why libglInterpose.dylib loaded so slowly?
 
 
Q