Qt 6.6和6.7使QML比以往更快:一个新的基准和分析

Qt Quick 和qml介绍 很多人不了解Qt Quick和Qml,还有很多人对其存在偏见。这篇文章就是来向这些有困惑的人介绍一下其是什么,有什么特点。首先,这两个是一个东西吗?答案:是的。但是,具体来说,Qt Quick是框架,qml是语言。Qt Quick是用C++搭建起来的一套DirectUI/Immediate UI框架,在这个框架上可以用和js语法一样的qml语言开发界面。和原来的QWidgets框架有什么关系吗?答案 阅读详情

Qt 6.6 and 6.7 Make QML Faster than Ever: A New Benchmark and Analysis

Qt 6.6和6.7使QML比以往更快:一个新的基准和分析

December 18, 2023 by Ulf Hermann | Comments

​2023年12月18日:Ulf Hermann |评论

It has been a while since the last time I've posted here and a lot has happened to the Qt Quick Compiler infrastructure. It's time to show some updated numbers. The benchmark discussed in my previous post was heavily focused on value types and lists of value types. It applied some rather complex tricks to eke out the maximum speedup between the interpreted and compiled versions of the same program.

​自从我上次在这里发帖以来,已经有一段时间了,Qt Quick编译器基础架构发生了很多变化。是时候展示一些最新的数字了。我在上一篇文章中讨论的基准主要集中在价值类型和价值类型列表上。它应用了一些相当复杂的技巧来在同一程序的解释版本和编译版本之间勉强实现最大的加速。

Today I'm going to work with something more familiar to most people. I've written a new benchmark that's mostly based on object types (and lists of those), and refrains from underhandedly instructing the compiler's type propagation using secret knowledge about the quirks of JavaScript operators. It also does something useful this time around. I've re-implemented the DeltaBlue constraint solver found in the V8 benchmarks in typed QML.

今天,我将与大多数人更熟悉的东西一起工作。我已经编写了一个新的基准测试,它主要基于对象类型(及其列表),并避免使用有关JavaScript运算符怪癖的秘密知识来暗中指导编译器的类型传播。这一次它也做了一些有用的事情。我已经在类型QML中重新实现了V8基准测试中的DeltaBlue约束求解器。

In and of itself this is a somewhat foolish endeavour. Since I want to use object types, I use a separate QObject for each variable and each constraint. QObjects, as we all know, have a rather significant static overhead. Allocating a QObject just to store a few integers is quite a waste. The original implementation uses JavaScript objects. While still not ideal, those are somewhat more lightweight. Furthermore, in order to run the actual algorithm, we have to call a lot of functions, and calling functions in QML contexts is generally more expensive than doing the same in JavaScript contexts. This is because the context and scope hierarchy in QML is much more complex, and we often have to perform extra type conversions.

这本身就是一种有点愚蠢的努力。由于我想使用对象类型,所以我为每个变量和每个约束使用一个单独的QObject。众所周知,QObjects有相当大的静态开销。仅仅为了存储几个整数而分配一个QObject是相当浪费的。最初的实现使用JavaScript对象。虽然仍然不理想,但它们更轻一些。此外,为了运行实际的算法,我们必须调用很多函数,并且在QML上下文中调用函数通常比在JavaScript上下文中调用更昂贵。这是因为QML中的上下文和作用域层次结构要复杂得多,而且我们经常需要执行额外的类型转换。

So, why did I do this? Most of you will want to deal with QObjects in a lot of places since all of Qt Quick is built on QObjects. You cannot avoid allocating a QObject if you need an Item. So, in a way the implementation using QObject as storage for everything, while slower, is also more realistic. You may argue that I should have written the benchmark with Qt Quick itself to get even more realistic. I decided not to do so because as soon as you add actual graphics to the mix, you have to deal with a lot more noisy data. Qt Quick itself often adds unpredictable overhead you don't want to deal with in a benchmark. For example, if you happen to have any text in your application, it has to create the font database at some point. Or, the scenegraph performs complex operations in the background to put the pixels on the screen. Those operations may or may not happen in a separate thread, and if so, there is still a synchronization phase for each frame. Finally, the graphics driver itself kicks in and performs its own calculations. This is all very interesing if you're benchmarking Qt Quick. However, I want to benchmark the QML language here. For me this is all just noise. Therefore, I've written a non-graphical application built with QObjects. You can find the code in this repository.

​那么,我为什么要这么做呢?你们中的大多数人都想在很多地方处理QObjects,因为所有的QtQuick都是基于QObjects构建的。如果需要一个Item,则无法避免分配一个QObject。因此,在某种程度上,使用QObject作为所有内容的存储的实现虽然速度较慢,但也更现实。你可能会争辩说,我应该用Qt Quick自己编写基准测试,以变得更加现实。我决定不这么做,因为一旦把实际的图形添加到混合中,就必须处理更多的嘈杂数据。Qt-Quick本身经常会增加不想在基准测试中处理的不可预测的开销。例如,如果应用程序中碰巧有任何文本,则它必须在某个时刻创建字体数据库。或者,场景图在背景中执行复杂的操作,将像素放在屏幕上。这些操作可能发生在单独的线程中,也可能不发生,如果发生,则每个帧仍有一个同步阶段。最后,图形驱动程序本身启动并执行自己的计算。如果正在对标Qt Quick,这一切都非常有趣。然而,我想在这里对QML语言进行基准测试。对我来说,这只是噪音。因此,我编写了一个使用QObjects构建的非图形应用程序。可以在此存储库中找到代码。

And here is the good news: The performance numbers for dealing with QObjects and calling typed functions on them have improved massively in Qt 6.6 and Qt 6.7.

这里有一个好消息:在Qt6.6和Qt6.7中,处理QObjects和在QObjects上调用类型化函数的性能大大提高。

Time taken to run the DeltaBlue benchmark with different versions of Qt

使用不同版本的Qt运行DeltaBlue基准测试所花费的时间

On the Y axis you see the milliseconds it took to run one iteration of the benchmark. Lower is better. The benchmark was run with:

  • Qt 5.15, the last version of the Qt5 series. This is our baseline. In Qt 5.15 the Qt Quick Compiler didn't generate any C++ code for functions and bindings. It only produced byte code to be interpreted or JIT-compiled.
  • Qt 5.15,Qt5系列的最后一个版本。这是我们的基线。在Qt 5.15中,Qt Quick编译器没有为函数和绑定生成任何C++代码。它只生成要解释或JIT编译的字节码。
  • Qt 6.2, since that is when the new Qt Quick Compiler was introduced as tech preview.
  • Qt 6.2,因为那是新的Qt快速编译器作为技术预览版推出的时候。
  • Qt 6.5, the last LTS version.
  • Qt 6.5,最后一个LTS版本。
  • Qt 6.6, the most recent release, highlighted where appropriate.
  • 最新发布的Qt 6.6在适当的地方进行了重点介绍。
  • A recent snapshot of Qt 6.7, highlighted where appropriate
  • Qt 6.7的最新快照,适当时突出显示

The setup

设置

The benchmarked program takes as input a number of variables and constraints between them. The variables are effectively numbers and the constraints hold:

基准程序将许多变量和它们之间的约束作为输入。变量实际上是数字,约束条件如下:

1.An input variable

1.输入变量

2.An output variable

2.输出变量

3.A scale variable

3.缩放变量

4.An offset variable

4.偏移变量

Either of these can be null. The constraint solver then manipulates the variable values, trying to achieve a state where for each constraint we get:

其中任何一个都可以为null。然后,约束解算器操纵变量值,试图实现这样一种状态:对于每个约束,我们得到:

output == input * scale + offset

There are more details to it, but this is the gist. Suffice to say, it's a somewhat demanding computational problem and as such well suited for our purposes.

它还有更多的细节,但这就是要点。可以说,这是一个有点苛刻的计算问题,非常适合我们的目的。

We run this on two sets of inputs: 1. A chain of alternating variables and constraints, 100 variables long. 2. A projection where 100 inputs are scaled and offset into 100 outputs.

我们在两组输入上运行此操作:1.变量和约束的交替链,100个变量长。2.一种投影,其中100个输入被缩放并偏移为100个输出。

The split between those two inputs is not very interesting. I'm giving them both together as a single data point in all the discussions below.

这两个输入之间的划分不是很有趣。在下面的所有讨论中,我将把它们作为一个单独的数据点。

Collected data points

收集的数据点

As mentioned before, there are two implementations of the actual algorithm:

如前所述,实际算法有两种实现方式:

1.The JavaScript version, almost as found in the V8 benchmark suite.

1.JavaScript版本,几乎可以在V8基准套件中找到。

2.The QML version I've written.

2.我写的QML版本。

Finally, I've split the execution into two phases for both implementations:

最后,我将两种实现的执行分为两个阶段:

1.A setup phase where all the objects are created that shall hold the variables and constraints.

1.一个设置阶段,在该阶段创建所有应包含变量和约束的对象。

2.The actual execution of the DeltaBlue algorithm.

2.DeltaBlue算法的实际执行情况。

Combining all this, a single run of the benchmark produces 4 data points:

综合所有这些,一次基准测试产生4个数据点:

1.The total time for the QML version

1.QML版本的总时间

2.The object creation time for the QML version

2.QML版本的对象创建时间

3.The total time for the JavaScript version

3.JavaScript版本的总时间

4.The object creation time for the JavaScript version

4.JavaScript版本的对象创建时间

It has to be said that we cannot run the exact same code for all versions of Qt to be tested:

不得不说的是,我们不能对要测试的所有版本的Qt运行完全相同的代码:

  • Qt 6.2 and Qt 5.15 cannot declare and initialize list properties in one QML binding/declaration. So, those had to be split in two lines.
  • Qt 6.2和Qt 5.15不能在一个QML绑定/声明中声明和初始化列表属性。所以,这些必须分成两行。
  • Qt 6.2 and Qt 5.15 do not know pragma ComponentBehavior so this had to be dropped, causing some IDs to become invisible to the compiler.
  • ​Qt 6.2和Qt 5.15不知道pragma ComponentBehavior,因此必须删除它,导致一些ID对编译器不可见。
  • Qt 6.2 and Qt 5.15 do not know that ':/qt/qml' is a default import path. It's added manually.
  • Qt 6.2和Qt 5.15不知道“:/qt/qml”是默认导入路径。它是手动添加的。
  • Qt 6.2 and Qt 5.15 cannot construct a QQmlComponent from URI and name. They have to load by URL instead.
  • ​Qt 6.2和Qt 5.15无法根据URI和名称构造QQmlComponent。它们必须通过URL加载。
  • Qt 5.15 has no proper build system API for QML modules. We build using qmake and CONFIG+=qtquickcompiler instead.
  • Qt 5.15没有适用于QML模块的正确构建系统API。我们使用qmake和CONFIG+=qtquickcompiler进行构建。
  • Qt 5.15 does not understand imports without versions. We add some versions to make it happy.
  • Qt5.15不理解没有版本的进口。我们添加了一些版本以使其愉快。

I could have avoided some of those differences, but I intentionally used the new features. They lead to improved performance where they are available, and the improved performance is what we are after.

我本可以避免其中的一些差异,但我有意使用了新功能。它们可以在可用的地方提高性能,而性能的提高正是我们所追求的。

No disk cache mode

无磁盘缓存模式

Now, since we don't have enough dimensions in our data, yet, we're adding another one. The benchmark by default uses Qt Quick Compiler to compile bindings and functions to C++. Comparing the numbers produced by the compiled code should give us the speedup caused by the compilation for each version of Qt, right? Well, unless the performance of the interpreter has also changed. In order to control for this, we also run the benchmark with QML_DISABLE_DISK_CACHE=1 for each version of Qt. This makes it ignore the compiled artifacts and instead work with the QML source code.

现在,由于我们的数据中还没有足够的维度,我们正在添加另一个维度。默认情况下,基准测试使用Qt Quick编译器来编译到C++的绑定和函数。比较编译后的代码产生的数字应该会给我们每个版本的Qt的编译带来的加速,对吧?除非解释器的表现也发生了变化。为了对此进行控制,我们还为每个版本的Qt运行QML_DISABLE_DISK_CACHE=1的基准测试。这使得它忽略了已编译的工件,转而使用QML源代码。

Finally, the Qt Quick Compiler Extensions have an extra feature that comes in very handy here:

最后,Qt Quick编译器扩展有一个非常方便的额外功能:

Static mode

静态模式

Consider three files A.qml, B.qml, and C.qml:

考虑三个文件A.qml、B.qml和C.qml:

// A.qml
import QtQml
QtObject { property int v: 11 }

// B.qml
import QtQml
A { property string v: "foos" }

// C.qml
import QtQml
QtObject { 
    property A a: A {}
    function evil(b: B) { a = b }
    function bark() { console.log(a.v) }
}

If you instantiate C and play with the evil and bark functions a bit, you will discover a feature of the QML language you didn't want to know about. It's called property shadowing. For great many properties and methods we cannot know in advance what types they will have at run time. This is a nasty problem for the Qt Quick Compiler. In Qt 6.6 it has learned to deal with it by wrapping the affected values in QVariant and checking their types where necessary. This comes at a performance cost, though. qmlsc has an extra option --static that tells it to ignore any shadowing. You can use it at your own risk. There are some properties that are intentionally shadowed. For example we're moving the focusReason property to QQuickItem, leaving a property of the same name in QQuickControl for backwards compatibility. Most shadowing, however, is a mistake.

​如果实例化C并稍微使用evil 和bark 函数,将发现QML语言的一个不想了解的特性。这叫做属性阴影。对于许多属性和方法,我们无法提前知道它们在运行时会有什么类型。这对Qt Quick编译器来说是个棘手的问题。在Qt 6.6中,它学会了通过将受影响的值包装在QVariant中并在必要时检查其类型来处理它。不过,这是以性能为代价的。qmlsc有一个额外的选项--static,它告诉忽略任何阴影。可以自担风险使用它。有些属性是有意隐藏的。例如,我们将focusReason属性移动到QQuickItem,在QQuickControl中保留一个同名属性以实现向后兼容性。然而,大多数阴影都是错误的。

The --static option was not available in Qt 6.2 and only takes effect with Qt 6.5, 6.6, and 6.7.

--static选项在Qt 6.2中不可用,仅在Qt 6.5、6.6和6.7中生效。

In our benchmark, we know we haven't shadowed anything, and we don't want to pay the performance price of checking. Therefore, we add a third, static, mode to each benchmark run to see how much we can gain in comparison to the normal, shadowable mode.

在我们的基准测试中,我们知道我们没有跟踪任何东西,我们不想为检查付出性能代价。因此,我们在每个基准测试运行中添加第三个静态模式,看看与正常的可阴影模式相比,我们能获得多少收益。

The results

结果

I've tried very hard to produce stable, comparable, data. The benchmarks are run on a linux machine booted directly into a shell, without init system. For program run I first try to warm the caches by performing a dry run, and then run 1000 iterations of the benchmark. For each benchmark function the program is re-started from scratch so that they cannot interfer with each other. So let's go back to the graph above.

我已经非常努力地制作出稳定的、可比较的数据。基准测试是在直接引导到shell的linux机器上运行的,不需要init系统。对于程序运行,我首先尝试通过执行干式运行来预热缓存,然后运行1000次基准测试迭代。对于每个基准函数,程序都是从头开始重新启动的,这样它们就不会相互干扰。让我们回到上图。

The first thing to note here is that I was not fully successful in my attempts to produce clean data. The JavaScript numbers should all be the same, especially within a single version of Qt. The way the QML code is compiled should not have any effect on the JavaScript execution. All the JavaScript at play here lives in a separate deltablue.js file that cannot be compiled to C++. Realizing this, I advise you to take all of the data with a roughly 5%-sized grain of salt.

这里首先要注意的是,我并没有完全成功地尝试生成干净的数据。JavaScript的数字应该是相同的,尤其是在Qt的单个版本中。QML代码的编译方式不应对JavaScript的执行产生任何影响。这里所有的JavaScript都存在于一个单独的deltablue.js文件中,该文件无法编译为C++。意识到这一点,我建议你用大约5%大小的盐来获取所有数据。

Another thing you can immediately see is that the QML version of the algorithm is generally much slower than the JavaScript version. As noted above, this is due to it being built on QObjects rather than JavaScript objects.

可以立即看到的另一件事是,QML版本的算法通常比JavaScript版本慢得多。如上所述,这是因为它是基于QObjects而不是JavaScript对象构建的。

On top of this, there is a noticable drop in performance between Qt 5.15 and Qt 6.2, for the QML version. If you look at the code you notice that there are a lot of as casts in there that tell the compiler what type to expect for some potentially shadowed value. In 5.15 as is a no-op. It was originally meant as a compile time only construct. Later, however, we noticed that this will lead to behavior differences between compiled and interpreted/JIT'ed code. To avoid those, we introduced type checks for both the compiled code and the interpreter and JIT. So, the later versions of Qt do more work here, but for Qt 6.2 and 6.5 it does not pay off, yet. Qt 6.2 and 6.5 still have to interpret or JIT most of the code here since their compilers' language coverage is rather limited.

除此之外,QML版本的Qt 5.15和Qt 6.2之间的性能也出现了显著下降。如果查看代码,会注意到其中有很多as强制转换,告诉编译器一些潜在的阴影值的类型。在5.15中,这是一个否定。它最初是作为一个只在编译时使用的构造。然而,后来我们注意到,这将导致编译的和解释的/JIT’ed代码之间的行为差异。为了避免这些问题,我们为编译后的代码、解释器和JIT引入了类型检查。因此,Qt的后期版本在这里做了更多的工作,但对于Qt 6.2和6.5,它还没有得到回报。Qt6.2和6.5仍然需要解释或JIT这里的大部分代码,因为它们的编译器的语言覆盖范围相当有限。

With that out of the way, let's look at the happy side of things. I've highlighted it in orange and red. Qt 6.6 takes about half the time Qt 6.5 takes to run the QML version of the benchmark, and Qt 6.7 improves on this some more. In static mode we get down to about a third of the 6.5 numbers. Here we get into a territory where the object creation overhead starts to dominate the benchmark. With Qt 6.7 in static mode, it took less time to run the whole benchmark than it took for the object creation alone with Qt 6.2.

抛开这些不谈,让我们看看事情快乐的一面。我用橙色和红色突出显示了它。Qt 6.6运行QML版本的基准测试所需的时间大约是Qt 6.5的一半,而Qt 6.7在这方面做了更多改进。在静态模式下,我们可以减少到6.5个数字的三分之一左右。在这里,我们进入了一个领域,对象创建开销开始主导基准测试。在Qt 6.7处于静态模式的情况下,运行整个基准测试所花费的时间比使用Qt 6.2单独创建对象所花费的更少。

Object creation also includes initial binding evaluation, which is why the object creation also benefits from compilation of bindings and expressions to C++. A complementary solution to object creation overhead will be qmltc, once it's ready.

​对象创建还包括初始绑定评估,这就是为什么对象创建还受益于将绑定和表达式编译到C++。对象创建开销的补充解决方案将是qmltc,一旦它准备好了。

[新版本]qt6.7.0入门使用-初学者详细操作指南-1 适合本科初学者入门qt的,(这里是面向电子信息工程和计算机科学技术的大三学生的入门教程)从安装使用到构建helloworld的gui应用程序的实例步骤。 阅读详情

相关推荐

win11 使用 Qt6.7 + mingw gcc 编译QGC V4.3.0

本文介绍在win11系统下,不使用visual studio,使用Qt Creator(Qt 6.7)编译QGC V4.3.0。

ganz2020的博客 2519

Qt 6.7功能介绍

在Qt 6.7中,除了自Qt 6.6以来已经提供的3D可视化之外,我们还增加了对2D条形图、折线图和散点图的支持……

BJ_bafangonline的博客 1695

Qt5开发从入门到精通——第一篇概述

Qt是一个跨平台的C++图形用户界面应用程序框架。它为应用程序开发者提供建立艺术级图形用户界面所需的所有功能。它是完全面向对象的,很容易扩展,并且允许真正的组件编程。在Qt程序开发过程中,除可以通过手写代码实现软件开发功能外,还可以通过Qt的GUI界面设计器(QtDesigner)进行界面的绘制和布局。该工具提供了Qt的基本可绘制窗口部件,如QWidget、QLabel、QPushButton和QVBoxLayout等。•对象查看器•属性编辑器。.........

weixin_44759598的博客 9520

Qt 6.7 正式发布!

部分新增功能已推出了技术预览版

Infedium的博客 3113

Qt Widgets与QML、Qt Quick的区别及对比

很多人会问已经有了Qt Widgets,为什么还要引入QML和Qt Quick? 其实引入QML和Qt Quick是为了更好地满足现代化UI界面(要炫酷和复杂的UI)的需求,提高开发效率和代码可维护性。同时,Qt Widgets和QML/Qt Quick可以灵活地结合使用。

热土程序园,利他愉己~ 4086

Qt Widgets、QML、Qt Quick 的区别

Widgets、QML、Qt Quick 傻傻分不清楚

青春不老,奋斗不止! 7万+

【QT教程】QT6 QML性能优化入门与进阶 QT QML性能优化

QT6_QML性能优化简介QT6_QML性能优化简介Qt 是一款广泛应用于桌面、移动设备和嵌入式系统的跨平台 C++ 应用程序框架。Qt 6 是该框架的最新版本,它带来了许多新特性和改进,包括对 QML 的性能优化。QML 是 Qt Quick 模块的一部分,它提供了一种声明性语言,用于构建用户界面和应用程序。在 Qt 6 中,QML 性能优化得到了显著改进,使得开发人员能够创建更快、更高效的应用程序。本文将介绍 Qt 6 中 QML 性能优化的基础知识,帮助您了解如何提高应用程序的性能。

QT性能优化QT原理源码QT界面美化 4243

ParallelsDesktop 安装 CentOS-6.9-x86_64-minimal 教程

安装参考 tools没做 想安装的可以参考这个 mac 本机环境: 系统:macOS Catalina version 10.15.6 虚拟机软件:parallels Desktop 15 for Mac( Parallels Desktop-15.1.4(47270)) Centos镜像: CentOS-6.9-x86_64-minimal.iso https://mirrors.aliyun.com/centos-vault/6.8/isos/x86_64/ http://vault.centos.

爱吃鱼的小明的博客 956

QT Widgets和QML区别

一.Qt Widgets适合传统的桌面程序开发 二.Qt Quick 是 Qt 4.7 主推的技术, Qt 官网介绍: Qt Quick 是一种高级用户界面技术,使用它可轻松用于移动开发、嵌入式设备使用的动态触摸式界面和轻量级应用程序的开发。在 Qt 5 中,QML 已经不再局限于移动开发,也可用于开发传统的桌面程序。三种全新的技术共同构成了 Qt Quick 用户界面创建工具包:一个改进的 ...

于大博 2万+

结合qtdesigner,用pyqtgraph在界面上绘制波形图(一)

思路:先画图,然后在qtdesigner上放一个容器,给这个容器添加一个布局,然后把图当作一个Widget放入布局中。二、PyUIC把test.ui转换成test.py,再新建一个load_test.py写脚本。就这么简单,基础部分就完成了。也可以给它添加样式,我知道的样式不算多,但会继续写。一、随便拖进来一个容器控件,我拖了一个Widget。要想把波形图显示在界面上,核心思想其实很简单。三、load_test.py的代码。

learninger_lt7的博客 1806

如何在离线的电脑上部署一个本地Deepseek(使用ollama)

例如,如果您的显卡显存为 16GB,官方推荐使用 32b 大小的 DeepSeek 模型。请根据您的硬件配置选择适合的模型版本,以获得最佳性能。首先我们需要将ollama和chatbox的安装包,Deepseek模型文件通过U盘或者光盘的形式导入到这台不能联网的电脑上。按照时间排序,找到最大的那个文件,就是gguf格式的模型,复制出来,改名为qwen2.5-coder0.5b.gguf。:基于开源模型(如 QWEN 和 LLAMA)微调,参数量从 1.5B 到 70B 不等,适合本地硬件部署。

qq_41854911的博客 1万+

Qt6 Qt Quick UI Prototype学习QML第一篇

Qt6 Qt Quick UI原型学习QML第一篇 开始创建项目 Qt Quick UI原型简介 .qmlproject文件 举例Window平台小例子 运行效果 QML语法 了解语法

Qt历险记,专注Qt技术,三年医疗设备研发经验,1年机器视觉研发经验,半年柔性传感研发经验。 1410

python基础语法与数据结构

本文摘要: Python基础语法包含输入输出、函数、变量、数据类型及运算符等内容。输入函数input()获取键盘输入并以字符串存储,输出函数print()可格式化输出数据。函数通过def定义,可带参数和返回值,提高代码复用性。变量无需声明类型,可动态赋值。数据类型包括数字、字符串、布尔及复合类型,可通过type()查看。运算符包含算术、赋值等类型,其中复合赋值运算符如+=可简化运算。类型转换函数如int()、str()等可实现显式类型转换。这些基础语法构成Python编程的核心要素。

MM602388的博客 442

全面认识 Qt Widgets、QML、Qt Quick

Qt Widgets、QML、Qt Quick ...呃 (⊙﹏⊙) ,简直了,傻傻分不清楚 !哈哈,没关系,来全面认识一下,也许还有一些你不知道的秘...

青春不老,奋斗不止! 3919

Zephyr、FreeRTOS 和 RT-Thread

你是…更适合用嵌入式新手,刚接触 RTOSFreeRTOS(入门简单)IoT 项目开发,需要 BLE/WiFi/MQTTZephyr(协议全)想快速构建可部署的产品Zephyr(模块统一)只做单个任务或简单状态机控制FreeRTOS(轻量)做平台化、持续集成、自动测试Zephyr(CI 支持强)

is0815的博客 2265

手搓UDS Bootloader|全网独家复现0x10诊断会话控制、详解会话跳转规则与S3超时机制、助力ECU在线刷写、固件迭代、车规安全升级落地

在车载UDS诊断(ISO 14229)与Bootloader固件升级架构中,0x10诊断会话控制服务是所有高级诊断、固件刷写功能的前置核心与权限管控入口,属于UDS基础必实现服务。车载ECU通过分级会话模式,隔离常规故障诊断、高级标定、固件重编程等高、低权限操作,从协议层面保障车载电控系统的安全性与稳定性。多数嵌入式开发者开发UDS Bootloader时,仅简单实现会话切换报文应答,未吃透会话强制跳转规则、S3安全超时机制、会话权限绑定、APP在线刷写跳转逻辑。

getusushu的博客 466

QT6 QML底层架构全景图:从引擎到渲染管线的深度解析

理解QML的底层架构,不仅仅是为了满足好奇心。它能让你在遇到棘手问题时,不再是盲目地猜测或搜索,而是能直击要害;它能指导你写出更高性能、更健壮的代码;更重要的是,它将你从一名“API调用者”提升为一名真正的“QT架构师”。 作为我们底层技术探索系列的开篇,将为您绘制一幅QT6 QML的全景架构图,带你从上至下,从QQmlEngine到QSGRenderer,领略这座技术大厦的宏伟与精妙。

QT性能优化QT原理源码QT界面美化 1761

黑猫带你学Nand第8篇:NandFlash的供电情况详解

是指在任何工作条件下,设备允许的最大电压、电流、功率以及温度等参数的界限值。

黑猫奥利奥的博客 1152

QT【QWidget和QML混合使用】

Qt Widgets、QML、Qt Quick的区别简述 看了之前关于 QML 的一些介绍,很多人难免会有一些疑惑: Q1:QML 和 Qt Quick 之间有什么区别? Q2:QtQuick 1.x 和 QtQuick 2.x 之间有什么区别? Q3:为什么要引入 QML/Qt Quick? Q4:Qt Widgets 和 QML/Qt Quick 哪个更好? 简述 QML VS Qt Quick 从概念上区分 从模块上区分 QtQuick 1x VS QtQuick 2x 为什么要引入 QMLQt

Wmll1234567的博客 5635

引入高分辨率特征层保持的YOLOv10小目标增强:从思路到完整实现

大概两个月前,我在做一个无人机航拍图像检测的项目,目标是识别图片里的小型车辆和行人。用的数据集是VisDrone,相信做小目标检测的朋友对这个数据集都不陌生。一开始我直接跑了官方YOLOv10的代码,结果在tiny vehicle这一类上mAP50只有可怜的0.312。那些小目标基本就是几个像素点,YOLOv10在三次下采样之后,这些小目标的特征几乎就消失不见了。 后来我折腾了大概三周,尝试了各种方法:改anchor、调loss权重、做数据增强、甚至考虑过换检测头。最后发现最有效的还是引入一个高分辨率特征

YOLO 52

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

QGroundControl 的 Qt 6 QML 编码技能指南:从规则到源码实践

本文面向 QGroundControl(QGC)开发者与 AI 编码助手,系统梳理仓库内置的 Qt/QML 编码技能文档([tools/skills/qt-qml/README.md](https://link.gitcode.com/i/84dd65754481bd63277a7569acc8481d))及其完整规则集 [SKILL.md](https://link.gitcode.com/i/

gitblog_00855的博客 882

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

QT QML模块的持续集成

持续集成简介持续集成简介持续集成(Continuous Integration,简称CI)是一种软件开发实践,它使得开发团队能够频繁地、小批量地提交代码变更,并通过自动化的构建和测试流程来验证这些变更。在QT和QML开发领域,持续集成同样具有重要意义,它有助于提高项目的质量、加快开发速度,以及增强团队协作。持续集成的好处持续集成具有多种好处,主要包括,早期发现问题,通过自动化的构建和测试,可以在代码提交后立即发现潜在问题,而不是在集成到主分支后才暴露出来。快速反馈。

QT性能优化QT原理源码QT界面美化 3406

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

1、Qt6 Quick 简介

Qt Quick 是 Qt 6 中使用的用户界面技术的总称。它是在 Qt 4 中引入的,现在在 Qt 6 中进行了扩展。Item {}在典型的项目中,前端是用 QML/JavaScript 开发的。后端代码(与系统交互并完成繁重工作)是使用 Qt C++ 开发的。这样可以自然地将更注重设计的开发人员和功能开发人员区分开来。通常,后端使用 Qt Test(Qt 单元测试框架)进行测试,并导出供前端开发人员使用。

MARQUIS888的专栏 1556

Qt Qml模块功能及功能解析

QtQml 是 Qt 6.0 中用于声明式 UI 开发和应用程序逻辑的核心模块,它提供了 QML 语言的支持和运行时环境。

kangjunfei的博客 1525

【AI辅助生成】QML与Qt 6新特性:打造现代化跨平台UI界面

Qt6带来了许多激动人心的新特性,为开发者提供了更强大的工具来创建现代化、跨平台的用户界面。

QT WIDGETS,QT QML,QT WEB、OpenCV 1172

Qt QML学习(一):Qt Quick 与 QML 简介

Qt QML学习(一):Qt Quick 与 QML 简介

qq_42994487的博客 4421
上一篇: 探索Qt Insight 1.6的新功能
下一篇: OpenCL™规范 3.2.4同步
꧁白杨树下꧂
博客等级 码龄15年 1019粉丝 209原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值