News for hackers. Stuff that matters.
Re:Developing a Beautiful and Performant Block Editor in Qt ... by rubymamis on Monday December 29, 2025 @11:49AM (#46422473)
> Saying “they’re both c++” is seems kind of misleading and meaningless right?

Not really, if you avoid writing Javascript code in your QML components, than most of your executable will end up being compiled C++ code. If you do write Javascript code in your QML components, than it *could also* be compiled to C++ code using the QML script compiler[1[2].

> QML apps that heavily implement core logic in javascript would be slow as balls.

The entire point is to separate logic and view where logic is written in C++ and QML simply represents the view (which almost end up being built upon simple primitives that *are* C++ objects). So if you keep this separation you get amazing performance with great simplicity and velocity.

[1] https://doc.qt.io/qt-6/qtqml-qtquick-compiler-tech.html

[2] https://doc.qt.io/qt-6/qtqml-qml-script-compiler.html

Re:Developing a Beautiful and Performant Block Editor in Qt ... by noodletheworld on Monday December 29, 2025 @07:09PM (#46427787)
> than it could also be compiled to C++

People who are going to use it should read the documentation.

“It depends” and “it’s still slow” are the fairest comments I can make about this.

Re:Developing a Beautiful and Performant Block Editor in Qt ... by rubymamis on Tuesday December 30, 2025 @12:22AM (#46429832)
I already showed in my benchmarks that my block editor is faster than all block editors on the market - even more than those that uses native frameworks. And there are ten of thousand of lines of QML code (and round the same of C++ as well).

You can't claim something is slow without showing empiric data. I showed mine when I claimed programming Qt C++ and QML together is fast. If you claim otherwise, you need to support it with data.

Re:Developing a Beautiful and Performant Block Editor in Qt ... by ahartmetz on Tuesday December 30, 2025 @06:05AM (#46432002)
If you ever run into trouble with execution of JS slowing down your Qt/QML application, you are using way too much JS. The most common performance issues in decently written applications are rendering of invisible items aka overdraw (especially on very weak embedded SoC GPUs) and slow startup time. There is tooling to find these and ways to fix or improve them.
Re:Developing a Beautiful and Performant Block Editor in Qt ... by rubymamis on Wednesday December 31, 2025 @02:22AM (#46442145)
Hi there!

> The most common performance issues in decently written applications are rendering of invisible items aka overdraw

That's indeed what I found as well! Especially, these hidden items consume a lot of unnecessary RAM. What tools do you know for Qt/QML that can help with this issue?

Re:Developing a Beautiful and Performant Block Editor in Qt ... by ahartmetz on Wednesday December 31, 2025 @11:25AM (#46445540)
QSG_VISUALIZE=overdraw, and the other options described here help with rendering performance well: https://doc.qt.io/qt-6/qtquick-visualcanvas-scenegraph-rende...

For another perspective and more details, RenderDoc (or another frame debugger if you have one) is a nice tool as well.

Also don't use Rectangle { color: "transparent" }, use Item {}. An Item has geometry, but doesn't render anything. A transparent Rectangle probably also doesn't render, but it's still (at least slightly) more resource-intensive and makes you look like you don't know what you're doing.

Use Loader, StackView and visible liberally to disable stuff that isn't currently relevant. If unloading causes trouble with lost state, you may be carrying too much state on the QML side.

Re:Developing a Beautiful and Performant Block Editor in Qt ... by rubymamis on Thursday January 01, 2026 @12:23PM (#46455936)
Thanks for that! Really helpful advice here.