First time launch a QT6.5.3 app(for x86 platform) using Webengine lib will block 2~3 minutes on Mac M1
-
When building a Qt application on a mac M1 machine using Qt 6.5.3 and the WebEngine library, targeting the x86_64 platform, there is a significant delay in the first launch of the application (about 2-3 minutes) before the interface appears, while subsequent launches are immediate. However, when building the same program for the arm64 platform, the application launches immediately.
If I copy this app(for x86_64 platform) to a Intel chip Mac, no this issue.
How can I solve this problem? I don't want It block so long time.
-
Hi and welcome to devnet,
Are you sure it's not because there's the translation layer that is starting up as well ? Thinking about Rosetta 2.
Did you check with a more recent version of Qt as well ?
-
@SGaist thanks for reply,I'm not sure the reason cause this blocking,but I strongly suspect that Rosetta 2 consumed a lot of time during the conversion, as I did not receive any logs during this period,on the other hand, QT5 will be better,Is it because of the size of the dynamic library? QT5 is 100+MB, QT6 is 350+MB
-
@SGaist I just compiled an example of QT called "simplebrowser" using QT6.5.3, setting CMAKE OSX ARCHITECTURES to x86_46. After compilation, I ran it and waited for 2-3 minutes for the first run to display the interface. Later, when I ran it again, there was no need to wait, on Mac M1
-
@SGaist , @fly-back we are struggling with same issue, after moving from Qt 5.15 to Qt 6.5.3 our app takes ~2 minutes for the first run, then next openings takes like 2 seconds. Previously on Qt 5.15 it looks around ~10 seconds for first run.
Both builds to x86_64 and running it from a Mac M1.
When I ran it from debug build it opens quickly as well, so this is just happening when I produce a .pkg and freshly install it. Any ideas of what may be happening here ? Anything that I can check to see what's going on?
Thanks in advance.
-
In that case, use a universal build and target both architectures.