https://bugs.documentfoundation.org/show_bug.cgi?id=155212
--- Comment #19 from Patrick Luby (volunteer) <guibomac...@gmail.com> --- Since this bug only occurs on macOS, I used the debug patch at the end of this comment to see how much time is being spent loading macOS fonts. In my tests, "--convert-to pdf With-Fonts.odt" takes at least 20 seconds on my M1 MacBook Pro. With the debug patch, the GetCoretextFontList() function gets called 2 times (cumulative time for that is +/- 0.5 seconds) to launch LibreOffice and display the Start Center. Then, when I run "--convert-to pdf With-Fonts.odt", the GetCoretextFontList() function gets called 89 more times and cumulative time in this function jumps to +/- 19 seconds. I count only 19 fonts in the With-Fonts.odt file so my first guess is that LibreOffice's macOS code is unnecessarily reloading all the system fonts. Not sure where this is happening yet but I will continue to read through the code and see if I can come up with any idea how to reduce the number of system font reloads. Note: below is the debug patch that I used: diff --git a/vcl/quartz/SystemFontList.cxx b/vcl/quartz/SystemFontList.cxx index 3ca09bfcf21e..c2a9cf97b1c5 100644 --- a/vcl/quartz/SystemFontList.cxx +++ b/vcl/quartz/SystemFontList.cxx @@ -282,12 +282,21 @@ bool SystemFontList::Init() std::unique_ptr<SystemFontList> GetCoretextFontList() { +static unsigned long nCount = 0; +static long long aTotal; +auto aStart = std::chrono::high_resolution_clock::now(); +nCount++; std::unique_ptr<SystemFontList> pList(new SystemFontList()); if( !pList->Init() ) { - return nullptr; + // return nullptr; + pList.reset(); } +auto aEnd = std::chrono::high_resolution_clock::now(); +auto aDeltaTime = aEnd - aStart; +aTotal += std::chrono::duration_cast<std::chrono::milliseconds>(aDeltaTime).count(); +fprintf(stderr, "Total elapsed milliseconds: %lu %lli\n", nCount, aTotal); return pList; } -- You are receiving this mail because: You are the assignee for the bug.