10 ms·
Ask HN: Smoothness and performance of Qt based systems vs. native apps and OS
There are many apps on Mac and Windows based on Qt, as well as ones built using the native SDKs exposed by respective platforms, like Cocoa and Dot Net. Are the ones built on Qt as smooth and performant as the native ones? Or will there be clear performance differences? There are questions like this on StackExchange, but they are more than a decade old, I am interested in knowing the current status!
On that note, how will an OS built around Qt perform compared to say iOS or Android, like Ubuntu Touch (assuming similar levels of underlying hardware)? Will Android and iOS and the apps on top of them will be naturally smoother, scrolls and app transitions being smoother than in Ubuntu Touch? Or is it that the Qt coding can be suitably tweaked in Ubuntu Touch to match iOS and Android performances?
- tssge 5y agoI find Qt is on par with native apps. Didn't even know it wasn't considered native. Electron apps on the other hand are very obvious from their resource usage, general laggyness and slow startup time. Say compare Discord (Electron) to Telegram (Qt) and it's like night and day.
- Closi 5y agoEh, I don't think it's always obvious - for instance Visual Studio Code I would never have guessed was an Electron app.
- jcelerier 5y agoWhen comparing on my machine, VSCode has much more latency than Qt apps for e.g. selecting text, reprocessing syntax coloration..
- pavlov 5y agoThere are a few places where it's obvious VS Code isn't a native Mac app. For example drag & drop between apps doesn't work as it should. (When initiating a drag, VS Code steals active app focus and brings its windows to front. It should stay in the background so that you can drag content into another app. This is a behaviour that views in Cocoa applications just inherit automatically.)
- formerly_proven 5y ago> (When initiating a drag, VS Code steals active app focus and brings its windows to front. It should stay in the background so that you can drag content into another app. This is a behaviour that views in Cocoa applications just inherit automatically.) This is a good design. It's very dumb that on other OSes initiating dragging steals focus and often hides where you want to drop.
- fouric 5y agoIt might not be obvious if you have a high-powered dev computer. It's very obvious if you have decade-old mid-range hardware (like me) or five-year-old low-end hardware (like millions of users). "I don't know what you're talking about, Electron is fast on my machine." makes about as much sense as "The application runs on my machine." Other people do not use your machine.
- Closi 5y agoYeah but the claim was just that it was flatly obvious which apps were electron. If the claim is just “it’s obvious which apps are electron if you have a decade old mid-range PC” then it’s not quite as bold of a statement.
- fouric 5y agoThat distinction of "flatly obvious" versus "obvious on a decade-only mid-range PC" seems to be pedantry. The parent comment doesn't say "flatly", for instance. In fact, it says "I find" which suggests personal experience, which would then mean that they weren't making a generalizable ("flatly obvious") claim. Regardless, choosing the average consumer PC for your country (including the lower-class) is a much more reasonable benchmark than a high-end (your?) computer - and it seems more likely that tssge's machines (or mine) are representative of that average device than yours are. I don't think that the statement was meant to be "bold" - it's pretty well-known that Electron performs extremely poorly on low-end devices, and the main reason why there's contention is because developers think that everyone has better computers than they actually do.
- Closi 5y agoWell it’s not extremely obvious to me that VSCode is an electron app on my low-to-mid range laptop, but maybe I’m just an idiot.
- throwaway661885 5y agoCare to say specs of the lap?
- rixed 5y agoEven on a very powerful modern machine you could probably tell the difference by looking at "abnormal" RAM usage.
- ChrisMarshallNY 5y agoQt is native, if you talk about running compiled and linked code that directly accesses native resources (C++ will work directly with the Apple OS). It is its own application framework (windows, buttons, labels, etc.), but, from what I can see, it does a damn good job of using native system resources, where possible. The answer to the OP is "it depends." There's no "Philosopher's Stone" for cross-platform development. I'd say a significant number of applications could benefit from Qt. A smaller number, from other hybrid systems. A lot of good development tools are Qt-based, and I like them fine. I have no experience with mobile Qt, though. Might be a different kettle of fish. I write native Apple, using Swift, and native frameworks, like AppKit, UIKit, and WatchKit. I have not yet started working extensively with SwiftUI, but I like what I see (except the documentation). I feel that true native development will always deliver the best UX, but, for many applications, the difference may not be worth the extra cost.
- gerikson 5y agoObviously "smoothness" means something other than "differentiable everywhere", but I'm at a loss to know what.
- CarVac 5y agoIn my experience QML is buttery smooth on Linux, even on older hardware, but it just isn't as smooth on Windows.
- ChuckNorris89 5y agoYep, that's why KDE is so smooth even on older hardware. But on Windows, some QT apps (GnuPG pinentry-qt for example) often have weird scaling issues where they de-snap and move out of their place.
- joezydeco 5y agoQt still hasn't figured out to work with Windows desktop scaling. It's a nightmare on high-DPI displays. I wrestled with this 5 years ago and it's still not fixed.
- deleted 5y ago[deleted]
- CarVac 5y agoWith QML you can implement native fractional scaling but I don't know how it interacts with Windows's scaling mostly because I don't have a high DPI screen on my Windows computer. My application has a setting where you can choose whatever arbitrary scale you want, smaller or larger than default.
- joezydeco 5y agoHere's a fun test when you get a High-DPI screen for testing: hook two screens to Windows, one high and one low-DPI. Then drag the Qt app from one window to the other. Virtualbox's windows GUI is Qt and shows the problem pretty easily.
- stagger87 5y agoIs this your only complaint with regards to Qt being a "nightmare" to use on a high DPI display?
- rvz 5y agoJust look at Telegram as a real example and compare that against the other messenger apps since the majority of them use Electron and Telegram uses Qt for some of its desktop clients.
- donboscow 5y agoYou mean to say Telegram is smoother than other apps? Will try it out. In general, would you say that Qt is supposed to work just as buttery smooth and native on Mac or iPhone as a native app? And will an OS built on Qt like Ubuntu Touch will be as smooth and beautifully craftable as iOS apps on iPhone?
- rvz 5y ago> You mean to say Telegram is smoother than other apps? If those other apps are using Electron then yes; Telegram is smoother. > In general, would you say that Qt is supposed to work just as buttery smooth and native on Mac or iPhone as a native app? Yes. No difference in RAM, Disk, or CPU usage than any other native app. > And will an OS built on Qt like Ubuntu Touch will be as smooth and beautifully craftable as iOS apps on iPhone? Yes. One example is AsteriodOS which is an OS for smartwatches built using Qt. [0] [0] https://asteroidos.org/ https://asteroidos.org/
- donboscow 5y agoIf you observe the Ubuntu Touch videos on YouTube, you will find that the animations, the graphics are not smooth and seamless, they stall, they freeze, they lag. Do you reckon it is more due to low end hardware underlying those phones as opposed to a fundamental problem?
- fleg 5y agoHard to say if it'll be as smooth as iPhone, but my experience with PinePhone shows that Qt-based environments (Ubuntu Touch, SailfishOS, even KDE) are way smoother than Phosh, which is based on Gtk. PinePhone isn't the most powerful phone out there, but I'd risk saying that SailfishOS is pretty smooth on it.
- jklinger410 5y agoSpeaking of QT...I've wanted to switch to a QT-based DE for a while but I don't like lxqt or Plasma. It would be really cool if there was another option.
- ChuckNorris89 5y agoWhat's wrong with KDE plasma? The beauty (and curse) of Plasma, is that it's so configurable, you can make it look and feel like anything else.
- McDyver 5y agoIf you are privacy-minded, KDE (with the kuserfeedback) should put you off, due to the user data it collects and sends back. You can disable the sending back, but not the collection. There are a number of packets that depend on this, so you can't just remove it. Although you can recompile it to disable data collection, it's not something everyone just does.
- ChuckNorris89 5y agoThis is the first time I'm hearing about this. Do you have a source?
- nick__m 5y agoi had the api reference open as i was trying to automate something in kwin... https://api.kde.org/frameworks/kuserfeedback/html/index.html https://api.kde.org/frameworks/kuserfeedback/html/index.html https://community.kde.org/Policies/Telemetry_Policy https://community.kde.org/Policies/Telemetry_Policy
- yaantc 5y agoWhich indicates it's opt-in so off by default. Also there's a pretty clear (IMHO) configuration in the settings that states what is send based on the level you select. So what's the problem? It's only a way to contribute usage feedback if and only as much as you want to.
- webmobdev 5y agoMy personal experience in using QT apps is that they load / render perceptibly slower than the native UIs and QT applications are slightly bulkier in size (storage space and memory). This is kind of understandable as QT emulates the UI through its own library (unlike, say, Lazarus IDE / Delphi GUI library that directly use the native UI library). However, size doesn't matter much today, and the very minor rendering delay is hardly discernable and doesn't reduce its usability in any manner. QT is a mature framework and especially suited for C++ developers. It's one of the popular ways open source developers choose to make their software available on multiple platforms. As for "OS built around QT" you can try it our yourself - KDE Plasma ( https://kde.org/ https://kde.org/ ) is a GUI for Linux / xBSD that is built with QT, and on the mobile scene, Sailfish OS ( https://sailfishos.org/ https://sailfishos.org/ ) also chose QT for its OS UI and recommends it for app development on its platform. All said, often nothing outperforms the native libraries in terms of usability. (Performance, in terms of resource use, is a different matter as there are GUI libraries that are actually lighter on the system than the native ones, and even QT).
- jcelerier 5y ago> This is kind of understandable as QT emulates the UI through its own library (unlike, say, Lazarus IDE / Delphi GUI library that directly use the native UI library). In the end it does not matter that you push pixels from qt5gui.dll or shell32.dll, no ?
- raphaelj 5y agoExcept that Qt might not be loaded/initialized by the time you launch your app.
- jcelerier 5y agoI develop a Qt app which I benchmark regularly and the actual Qt initialization (from exec to an initialized QApplication) on an average computer is on the order of a few milliseconds (10-15 here). Checked a bit more and the time to first frame, with GL set up, etc., is ~100ms.
- Tajnymag 5y agoIs it bad that I thought of QT as a native UI framework?
- notriskfree 5y agoIf you mainly use Linux that would be a reasonable point of view to take. However it runs in many environments so it is more like 'a cross platform framework' It is native code, so in that sense it also native.
- jcelerier 5y agoQt is the native UI of many different operating systems
- Shadonototra 5y agomost mac apps aren't based on QT, they are based on cocoa, mac people don't need to use 3rd party when the official solution destroy the competition macOS apps are smoother than windows apps because microsoft forces JIT'd applications, which hurts both startup and UX, you can feel JIT doing work when there are animations / click on buttons, and installation is slow because it copies a shit ton of DLLs and a massive runtime even more noticeable on 120hz+ monitors linux is the worst, people are addicted to python, and god knows how slow it is
- raphaelj 5y agoMost Linux and Windows apps do any significant computation except when relying on (usually) native/C/C++ libraries that do it (GUI, science stuff, IO ...). So it does not really matter if it is coded in Python, C# or C++, as most of the CPU time is spent on native code anyway. Code quality is a way more important factor in app perceived slowness.
- coldacid 5y agoI wouldn't go calling .NET a "native SDK" for Windows. That's like saying Java's a native SDK for Windows or macOS or Linux.
- gavinray 5y agoWhy? > "That's like saying Java's a native SDK for Windows or macOS or Linux." Not an unreasonable claim if you're packaging with Graal's native-image tbh. Dotnet has NativeAOT, and JVM languages have GraalVM (with Kotlin Native too for Kotlin, and Scala Native too for Scala). What you get when building an application with Dotnet Native, GraalVM native-image, Kotlin Native, Scala Native, etc, is architecture-dependent native code identical to compiling with "CC myfile.cpp" So I don't find that unreasonable tbh. If I can use NativeAOT/Dotnet Native Exports on .NET/GraalVM on the JVM to do this, as well as export a static/dynamic lib with a C ABI that I can use on whatever OS from C/C++/Rust code or whatever, I really don't know what else you need to call something "native" tbh.
- donboscow 5y agoGuys, I see my question greyed out. And I also see some comments greyed out. What does that mean? They are getting downvoted?
- umen 5y agoCan you list beautiful Qt Apps that are open source
- xolve 5y agoOther than Python what are great Qt bindings available. I wish I could code for Qt in Zig or rust.