I got the same problem. I'm currently on Big Sur 11.3, Xcode 12.5. Start a debug session of a macOS application UE4Editor is really slow since about 3 weeks. I expect this to be solved soon. I do time profiling. If we remove time for "instruments" to profile itself, So we can see that nearly all time is spend in debugserver process. And that UE4Editor is stuck in dlopen.
s 45.6% 0 s debugserver (37427)
s 45.6% 0 s Main Thread 0x5af1b6
s 45.6% 0 s start
s 45.6% 0 s main
s 45.6% 0 s RNBRunLoopInferiorExecuting(RNBRemote*)
s 45.5% 0 s RNBRemote::HandleReceivedPacket(RNBRemote::PacketEnum*)
s 45.4% 0 s RNBRemote::HandlePacket_jGetLoadedDynamicLibrariesInfos(char const*)
s 45.4% 0 s DNBGetLibrariesInfoForAddresses(int, std::__1::vectorunsigned long long, std::__1::allocatorunsigned long long &)
s 45.4% 0 s MachProcess::GetLibrariesInfoForAddresses(int, std::__1::vectorunsigned long long, std::__1::allocatorunsigned long long &)
s 45.4% 0 s _dyld_process_info_create
s 45.4% 0 s withRemoteBuffer(unsigned int, unsigned long long, unsigned long, bool, int*, void (void*, unsigned long) block_pointer)
s 45.4% 0 s ___dyld_process_info_create_block_invoke
s 45.4% 0 s std::__1::unique_ptrdyld_process_info_base, dyld_process_info_deleter dyld_process_info_base::makedyld_all_image_infos_64, dyld_image_info_64(unsigned int, dyld_all_image_infos_64 const&, unsigned long long, int*)
s 45.4% 0 s withRemoteBuffer(unsigned int, unsigned long long, unsigned long, bool, int*, void (void*, unsigned long) block_pointer)
s 45.2% 2.00 ms invocation function for block in std::__1::unique_ptrdyld_process_info_base, dyld_process_info_deleter dyld_process_info_base::makedyld_all_image_infos_64, dyld_image_info_64(unsigned int, dyld_all_image_infos_64 const&, unsigned long long, int*)
s 45.2% 0 s dyld_process_info_base::addImage(unsigned int, bool, unsigned long long, unsigned long long, char const*)
07 s 41.6% 0 s dyld_process_info_base::copyPath(unsigned int, unsigned long long)
07 s 41.6% 1.00 ms withRemoteBuffer(unsigned int, unsigned long long, unsigned long, bool, int*, void (void*, unsigned long) block_pointer)
06 s 41.5% 1.00 ms RemoteBuffer::create(unsigned int, unsigned long long, unsigned long, bool)
06 s 41.5% 1.00 ms RemoteBuffer::map(unsigned int, unsigned long long, unsigned long)
s 40.1% 1.00 ms mach_vm_remap_new
s 40.1% 2.00 ms _kernelrpc_mach_vm_remap_new
s 40.1% 1.00 ms mach_msg
s 40.1% 2.96 s mach_msg_trap
00 ms 0.6% 1.00 ms mach_vm_deallocate
00 ms 0.5% 38.00 ms _platform_memmove$VARIANT$Haswell
00 ms 0.1% 4.00 ms _malloc_zone_malloc
00 ms 0.0% 1.00 ms malloc
00 ms 0.0% 0 s invocation function for block in dyld_process_info_base::copyPath(unsigned int, unsigned long long)
00 ms 0.0% 0 s free_small
00 ms 0.0% 1.00 ms _Block_object_dispose
00 ms 3.4% 0 s dyld_process_info_base::addInfoFromRemoteLoadCommands(unsigned int, unsigned long long)
00 ms 0.1% 10.00 ms dyld_process_info_base::addInfoFromLoadCommands(mach_header const*, unsigned long long, unsigned long)
00 ms 0.1% 0 s RemoteBuffer::create(unsigned int, unsigned long long, unsigned long, bool)
00 ms 0.0% 0 s _dyld_process_info_for_each_image
00 ms 0.0% 0 s MachProcess::GetMachOInformationFromMemory(unsigned int, unsigned long long, int, MachProcess::mach_o_information&)
00 ms 0.0% 0 s free_tiny
00 ms 0.0% 0 s RNBRemote::SendPacket(std::__1::basic_stringchar, std::__1::char_traitschar, std::__1::allocatorchar const&)
00 ms 0.0% 0 s RNBRemote::HandlePacket_v(char const*)
00 ms 0.0% 0 s RNBRemote::HandlePacket_p(char const*)
00 ms 0.0% 0 s RNBRemote::HandlePacket_c(char const*)
00 ms 0.0% 1.00 ms DYLD-STUB$$__error
00 ms 0.0% 0 s HandleProcessStateChange(RNBRemote*, bool)
00 ms 0.0% 0 s PThreadEvent::WaitForSetEvents(unsigned int, timespec const*) const
00 ms 0.0% 0 s MachTask::ExceptionThread 0x5af1be
s 40.3% 0 s Instruments (37042)
00 ms 3.3% 0 s Xcode (3162)
00 ms 3.0% 0 s WindowServer (150)
00 ms 2.1% 0 s lldb-rpc-server (6834)
00 ms 1.5% 0 s UE4Editor (37426)
00 ms 1.3% 0 s -[UE4AppDelegate runGameThread:] 0x5af2f7
00 ms 1.3% 0 s thread_start
00 ms 1.3% 0 s _pthread_start
00 ms 1.3% 0 s __NSThread__start__
00 ms 1.3% 0 s -[FCocoaGameThread main]
00 ms 1.3% 0 s -[UE4AppDelegate runGameThread:]
00 ms 1.3% 0 s GuardedMain(char16_t const*)
00 ms 1.3% 0 s EnginePreInit(char16_t const*)
00 ms 1.3% 0 s FEngineLoop::PreInit(char16_t const*)
00 ms 1.3% 0 s FEngineLoop::PreInitPostStartupScreen(char16_t const*)
00 ms 1.3% 0 s FEngineLoop::LoadStartupModules()
00 ms 1.3% 0 s FPluginManager::LoadModulesForEnabledPlugins(ELoadingPhase::Type)
00 ms 1.3% 0 s FPluginManager::TryLoadModulesForPlugin(FPlugin const&, ELoadingPhase::Type) const
00 ms 1.3% 0 s FModuleDescriptor::LoadModulesForPhase(ELoadingPhase::Type, TArrayFModuleDescriptor, TSizedDefaultAllocator32 const&, TMapFName, EModuleLoadResult, FDefaultSetAllocator, TDefaultMapHashableKeyFuncsFName, EModuleLoadResult, false &)
00 ms 1.3% 0 s FModuleManager::LoadModuleWithFailureReason(FName, EModuleLoadResult&)
00 ms 1.2% 0 s FMacPlatformProcess::GetDllHandle(char16_t const*)
00 ms 1.2% 0 s GetDllHandleImpl(NSString*, NSString*)
00 ms 1.2% 0 s dlopen
Post
Replies
Boosts
Views
Activity
The problem seems to be related to Big Sur 11.3 and Big Sur 11.4. Not to specific Xcode version (Xcode 12.4 got about the same results that 12.5).
I do some measures for 2 applications in debug on Big Sur 11.1 and Big Sur 11.4. Here the launch time results:
App1 - Big Sur 11.1 = 0m21s - Big Sur 11.4 = 1m20s
App2 - Big Sur 11.1 = 0m31s - Big Sur 11.4 = 5m08s
Conclusion: Debugging Application on 11.4 is between 4 to 10 time slower than 11.1.
Note App2 have nearly 100 dylib to load while App1 have only 30.
For me, passing to macOS 12 beta, solve the problem. Launching time returned to normal. Unhappily I can stay on 12 beta, because there are too much problems to work with.
For me, 12.5.1 doesn't fix the slow debug speed.
I redo my tests/measure again, but with ne Xcode 12.5.1 release. I didn't see any improvements at all:
On the test machine
macOS 11.2.1 with Xcode 12.5.1, Starting application in debug took 25s.
macOS 11.4 with Xcode 12.5.1, it take between 85s to 135s (3.5 to 6 time slower)