qt5.9支持linux,科学网—Qt5.9发布了,Qt 5.9长期支持版之性能改善 - 陈德鹏的博文...

本文主要是介绍qt5.9支持linux,科学网—Qt5.9发布了,Qt 5.9长期支持版之性能改善 - 陈德鹏的博文...,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

PerformanceImprovements with Qt 5.9 LTS

Qt5.9长期支持版之性能改善

Qt 5.9 LTS improves Qt Quick and QMLperformance significantly, especially with Linux on ARM. We have worked hard toimprove the performance in multiple areas: within the QML engine, Qt Quickgraphics, QML Compiler and in the Qt Quick Controls, to name some examples.Performance has improved significantly across all areas, with some items beingseveral times faster than with our previous long-term supported release Qt 5.6LTS.

显著改善了Qt Quick 和 QML之性能,尤其在ARM平台上之Linux。QML引擎,Qt Quick 图形,Qt QML编译器,Qt Quick 控件,相对于5.6,有些方面的性能提高了数倍。

Weare regularly running several different kinds of performance tests to see howthe various optimizations work across different platforms. Some of theseresults are visible at testsresults.qt.io,while some tests have not been automated yet. Whenever possible, we areaiming to optimize the performance of all supported operating systems and CPUarchitectures. For readability and because Linux on ARM has been an area ofparticular focus with Qt 5.9 LTS, it is the one discussed in this post.Typically, the other platforms have received roughly similar improvements.

测试了不同平台,有些结果于网站testsresults.qt.io可见,重点关注ARM平台上之LINUX优化,其它平台已得到了类似改善。

Qt Quick Application StartupTime

68c2f7ba343990cc30fc06cf9d628461.pngStartup time of a QtQuick application is often critical in the embedded space. This is truefor small single-process embedded systems, as well as for more complexmulti-process devices. We have offered a commercial-only tool called the QtQuick Compiler since Qt 5.3 to improve the startup time by leveraging the C++compiler to compile QML into a normal C++ binary(利用CPP编译器把QML编译为普通的CPP二进制文件). Between Qt 5.6 LTS and Qt 5.9LTS, the performance of the QML engine has improved with each new Qt release(Qt5.6~5.9之间,每一次发布,QML引擎均得到改善), resulting in improved application startup time. Qt 5.8 introducedQML caching(引入了QML缓存机制), whichmakes second and subsequent runs of the applications to be faster(使得第二次和后续应用程序运行更快). Qt 5.9 also offers a possibility to pre-populate the cache (预填充缓存机制来对已运行一次的应用改善性能)to reach improved performance already with the first run. With theQt Quick Compiler, the first run is also already fast(使用Qt Quick Compiler第一次运行也已变得更快。).(下面的图例,注意是越短标识性能越高)

64位ARM总是比32位性能好很多,值得关注的是64bit ARM硬件平台为NVIDIA TX1 Linux。

方法为通过编译器把

Eachapplication has unique characteristics so the exact benefit in startup time forusing Qt 5.9 LTS and/or the Qt Quick Compiler will vary. Typically, the moreQML used, the bigger the improvement is(QML用得越多,性能改善越大).In Qt 5.9 LTS we offer two alternative options(两种改善机制选项): the commercial-only Qt Quick Compiler (一种仅对商业化的Qt Quick Compiler)and a new tool to populatethe cache ahead-of-time(一个新工具来提前填充缓存), which isavailable for both open-source and commercial users.(这对开源和商业用户均可用) The performance and reduced startup time are in practice the samewith both approaches in Qt 5.9 LTS(在Qt 5.9LTS中两种方法的性能改善在实践中是相同的。).

Whencomparing the startup time for the same Qt Quick application with Qt 5.6LTS without the Qt Quick Compiler to the startup time of Qt 5.9 LTS using theQt Quick Compiler (or populated cache), the improvement is a whopping 60% onNXP i.MX6(对NXPi.MX6CPU 启动时间性能提高了60%). Whenusing the commercial-only Qt Quick Compiler of Qt 5.6 LTS the improvement instartup time is 54% (compared to Qt 5.6 LTS without the Qt Quick Compiler inuse)(带商业化Qt Quick Compiler相对于不带的Qt 5.6 LTS,启动性能提升了54%). Comparing the startup times of Qt 5.6 LTS and Qt 5.9 LTS when bothare using the Qt Quick Compiler the improvement is 14% on NXP i.MX6(都使用Qt Quick Compiler的5.6对5.9,性能提升了14%,对NXPi.MX6).

Theapplication used for the tests was the Qt Quick Controls 1 gallery and thetests were run with Linux on NXP i.MX6 and NVIDIA Tegra X1. We used theControls 1 example because they are much heavier than Controls 2, thus betterresembling a typical real-life Qt Quick application. For more measurements ofQt Quick application startup times, please check out the earlier blog post.For instructions to further optimize startup time of a Qt Quick application,please read the second post of ourearlier fastboot blog series.

用于测试的应用是Qt Quick Controls 1,测试平台为Linux on NXP i.MX6and NVIDIA Tegra X1。

Qt Quick ControlsPerformance

Qt5.6 LTS features Qt Quick Controls 1 whileQt 5.9 LTS features the Qt QuickControls 2fullysupported. The main design principle ofQt Quick Controls 2has beenperformance, as can be seen already from the blog post announcingthem. From the very beginning,the key focus areaof the newQt Quick Controls 2 has been for embeddeddevices and systems.However, these can equally well be used on all supported platforms.Compared to Qt Widgets or Qt Quick Controls 1, the key difference of Qt QuickControls 2 is that they do not adapt to platform style. We do offer multipledifferent styles for Qt Quick Controls 2 and it is easy to make your own styleas well. From an architectural viewpoint, the key difference of Qt QuickControls 2 is that they leverage C++ for everything that can be done with C++and offer just the QML API for applications to use.

Qt QuickControls 2特别强调性能,关键关注领域为嵌入式设备和系统。相对于Qt Widgets or Qt QuickControls 1,它不是适应平台式样风格,而是提供多种风格式样Qt Quick Controls 2,容易创建自己的式样风格。从架构的观点来看,QtQuick Controls 2的关键不同点为对每一项能用C++的都利用C++来处理,仅为应用提供QMLAPI供其使用。

2bdcb5be45364d0d3f6b66baf2a717d9.png

Asillustrated in the graph above, the performance improvement is huge (note: thehigher the bar, the better the performance is). We used NXP i.MX6 running Linuxfor the measurements. For some of the controls the performance is 14xbetter than before(最高性能高14倍), and on average the performance hasbeen improved 6x comparing Qt 5.9 LTS with Qt Quick Controls 2 to Qt 5.6 LTSwith Qt Quick Controls 1(平均性能提高6倍). To benefit from the improved performance, the application needs tobe ported to use Qt Quick Controls 2. This is typically quite straightforward (这往往十分简单)and Qt Quick Controls 2 offers most of the common controls(提供了绝大多数控件). Before porting, please check the documentation,as some controls, such as TableView, are not currently available with Qt QuickControls 2(移植前,请查看文档,诸如TableView的一些控件,在Qt Quick Controls 2中当前是不可用的。).

Shader Cache着色器缓冲

Qt5.9 LTS introduces a new feature to cache OpenGL shaders to disk after thefirst run(引入了一个新特性,在第一次运行后,缓冲OpenGL 着色器), as explained in the blog post introducingthe shader cache. If your Qt Quick application is using OpenGLshaders, which is quite often the case这是常遇见的情形, itwill achieve a significant improvement in startup time comparedto earlier versions of Qt. When comparing the performance of Qt 5.6 LTS toQt 5.9 LTS using the same Qt Quick application with 10 shaders十个着色器, we can see a significant improvement in the initialization time ofthe shaders(着色器初始化时间). Some of the performanceimprovement observed in the measurement is due to the overall improvements inthe graphics performance, but most of the improvement can be attributedto the new shader cache feature.

e9de03ad0175a35c8a54ca2412df2097.png

Qt5.9 LTS is a whopping 7x faster than Qt 5.6 LTS on startup with the same exactQt Quick application running the same hardware(同样硬件和Qt Quick应用,快乐7倍。). Just like the previous measurementsdescribed in the blog post, this test has also been conducted usingNXP i.MX6 running Linux. The performance improvement is dependent on thehardware and especially the GPU plays a major role(性能的改善依赖于硬件,尤其是GPU扮演主要角色). Based on our measurements thereare significant improvements with every piece of hardware we have tested –including ones that implement cache feature already in the OpenGL driver.

Memory Footprint(足印;占用空间;占地面积) Improvements 内存占用改善

In Qt5.8 we introduced a new configuration system and made other improvementsto reduce the binary size of the Qt framework libraries usedfor different applications(5.8中引入新的配置系统减少Qt框架库的二进制代码大小). This was developed as part of the Qt Lite project, which focusedspecifically on reducing the application size(特别关注减少应用程序是大小). With Qt 5.9 LTS we have further polished and tuned the availableconfigurations so that more and more different kinds of applications can reachtheir minimal Qt configuration(5.9中可达到最小之配置). Reducing the size of a Qt 5.6 LTS application is possible mainlyby just using the modules needed by the application and statically linking thebinary(5.6中主要使用为应用仅使用必要之模块,以及链接为静态二进制库). Because of dependencies within the Qt framework, the linker is notable to reach as small binary size as it is possible with Qt 5.9 LTS using thenew configuration tool.

由于Qt框架的依赖性,连接器不可能达到最小二进制程序大小。5.9使用了新配置工具

02b2e1b97b7c9b4a50451fa1dd0b8999.png

Weused a simple, but non-trivial, Qt Quick application (samegame) tocompare the needed binary size of the application itself as well as all the Qtlibraries it needs. With Qt 5.6 LTS the application requires 24,5MB whenlinking dynamically. Using static linking, the size is reduced to 13,8MB(still using Qt 5.6 LTS). Leveraging the new configuration tool in Qt 5.9LTS and with other Qt Lite improvements, the exact same application only needs5,4MB when static linking is used. Percentage-wise, the Qt 5.9 LTS binary sizeof the application is 61% smaller than the same application with Qt 5.6 LTS andstatic linking – without losing any functionality or making any changesto the application.(厉害了,我的Qt5.9)

Improvement in JavaScriptPerformance JavaScript性能之改善

Withthe improvements in the QML engine in Qt 5.9 LTS the performance of JavaScriptexecution has also improved(QML 引擎的改善,同时JavaScript的执行性能亦得到改善). If the Qt Quickapplication leverages JavaScript, there is a huge improvement in performancecompared to Qt 5.6 LTS, especially on 64-bit ARM. One example of heavilyleveraging JavaScript is using three.js on top of Canvas 3D, and smalleramounts of JavaScript are often used in Qt Quick applications.尤其是对64位AMR平台,如果Qt Quick应用利用了JavaScript,性能改善明显。

.Comparison.png

Themeasurements are done with v8-bench, which can be found in the qtdeclarativerepository. Additional measurements are available at testresults.qt.io.With the v8-bench performance benchmark results of Qt 5.6 LTS compared to Qt5.9 LTS, the improvement on 32-bit ARM is 16%(32位ARM提升16%), but on 64-bit ARM the improvement is awhopping 302% (i.e. 4x improvement)(64位ARM提升302%). Thereasons for the huge improvements are that Qt 5.9 LTS fully supports64-bit ARM processors combined with the improvements in the QML engine.巨大改善之原因为Qt 5.9 LTS完全支持64bitARMCPU,结合QML引擎之改善。

Overall Qt Quick PerformanceImprovements全面Qt Quick 性能之改善

qmlbench_example.pngThe examples above arejust some of the highlights from many improvements we have done to theperformance of Qt Quick in Qt 5.9 LTS. We have tuned multiple individual areasand optimized the execution paths within the Qt framework. It is important tonote that we have also worked hard not to regress(后退,回归,退化) in any areas. To avoidregressions, we are regularly running a comprehensive Qt Quick benchmark suitecalled Qmlbench. With the Qmlbench tool we can see the performance of the mostcommonly used Qt Quick functionality as well as the functionality thatis used less frequently. For more details, please review the thorough explanationof how we are using Qmlbench to avoid regressions.

Whencomparing Qt 5.6 LTS and Qt 5.9 LTS in the same environment with thecomprehensive Qmlbench measurements, we can see  that some areas improvedup to 130% as shown in the graph above. Especially layout and complex textperformance has improved drastically尤其在布局和复杂文本性能的改善显著. The average improvement ofQt 5.9 LTS compared to Qt 5.6 LTS in all Qmlbench tests is 14% (measured onLinux)改善性能,基于Qmlbench测试,平均改善14%.Despite which functionality is used, the improvement in performance of a QtQuick application running Qt 5.9 LTS compared to Qt 5.6 LTS is clear andtangible for most applications.

Conclusions

Inthis blog post在本博客帖子中, I summarized some of the multiple performance improvementsavailable with Qt 5.9 LTS. Compared to Qt 5.6 LTS, the performance of the sameapplication running on Qt 5.9 LTS is significantly higher. Without making anychanges to the application, except for compiling it for the new Qt 5.9 LTS, theperformance is significantly improved. Ranging from improved applicationstartup time and smaller footprint through to increased graphicsperformance, Qt 5.9 LTS is a major step forward performance-wise. Taking someof the new features, such as Qt Quick Controls 2, into use even furthers theperformance improvements available with Qt 5.9 LTS.

Interestedin taking a closer look? Qt 5.9.0 has been released today. You can get it withyour online installer, from the Qt Account orfrom the Qt Downloads page (foropen-source users).

Formore details of Qt 5.9 LTS, please check the Qt 5.9 LTS releaseblog post.

转载本文请联系原作者获取授权,同时请注明本文来自陈德鹏科学网博客。

链接地址:http://blog.sciencenet.cn/blog-338872-1058803.html

上一篇:url inverse problem source code cpp

下一篇:Qt Creator 4.4.0 released 发布了。。。。。您值得关注。。...

这篇关于qt5.9支持linux,科学网—Qt5.9发布了,Qt 5.9长期支持版之性能改善 - 陈德鹏的博文...的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/363678

相关文章

Vue3 的 shallowRef 和 shallowReactive:优化性能

大家对 Vue3 的 ref 和 reactive 都很熟悉,那么对 shallowRef 和 shallowReactive 是否了解呢? 在编程和数据结构中,“shallow”(浅层)通常指对数据结构的最外层进行操作,而不递归地处理其内部或嵌套的数据。这种处理方式关注的是数据结构的第一层属性或元素,而忽略更深层次的嵌套内容。 1. 浅层与深层的对比 1.1 浅层(Shallow) 定义

性能测试介绍

性能测试是一种测试方法,旨在评估系统、应用程序或组件在现实场景中的性能表现和可靠性。它通常用于衡量系统在不同负载条件下的响应时间、吞吐量、资源利用率、稳定性和可扩展性等关键指标。 为什么要进行性能测试 通过性能测试,可以确定系统是否能够满足预期的性能要求,找出性能瓶颈和潜在的问题,并进行优化和调整。 发现性能瓶颈:性能测试可以帮助发现系统的性能瓶颈,即系统在高负载或高并发情况下可能出现的问题

linux-基础知识3

打包和压缩 zip 安装zip软件包 yum -y install zip unzip 压缩打包命令: zip -q -r -d -u 压缩包文件名 目录和文件名列表 -q:不显示命令执行过程-r:递归处理,打包各级子目录和文件-u:把文件增加/替换到压缩包中-d:从压缩包中删除指定的文件 解压:unzip 压缩包名 打包文件 把压缩包从服务器下载到本地 把压缩包上传到服务器(zip

性能分析之MySQL索引实战案例

文章目录 一、前言二、准备三、MySQL索引优化四、MySQL 索引知识回顾五、总结 一、前言 在上一讲性能工具之 JProfiler 简单登录案例分析实战中已经发现SQL没有建立索引问题,本文将一起从代码层去分析为什么没有建立索引? 开源ERP项目地址:https://gitee.com/jishenghua/JSH_ERP 二、准备 打开IDEA找到登录请求资源路径位置

高效+灵活,万博智云全球发布AWS无代理跨云容灾方案!

摘要 近日,万博智云推出了基于AWS的无代理跨云容灾解决方案,并与拉丁美洲,中东,亚洲的合作伙伴面向全球开展了联合发布。这一方案以AWS应用环境为基础,将HyperBDR平台的高效、灵活和成本效益优势与无代理功能相结合,为全球企业带来实现了更便捷、经济的数据保护。 一、全球联合发布 9月2日,万博智云CEO Michael Wong在线上平台发布AWS无代理跨云容灾解决方案的阐述视频,介绍了

嵌入式QT开发:构建高效智能的嵌入式系统

摘要: 本文深入探讨了嵌入式 QT 相关的各个方面。从 QT 框架的基础架构和核心概念出发,详细阐述了其在嵌入式环境中的优势与特点。文中分析了嵌入式 QT 的开发环境搭建过程,包括交叉编译工具链的配置等关键步骤。进一步探讨了嵌入式 QT 的界面设计与开发,涵盖了从基本控件的使用到复杂界面布局的构建。同时也深入研究了信号与槽机制在嵌入式系统中的应用,以及嵌入式 QT 与硬件设备的交互,包括输入输出设

Linux 网络编程 --- 应用层

一、自定义协议和序列化反序列化 代码: 序列化反序列化实现网络版本计算器 二、HTTP协议 1、谈两个简单的预备知识 https://www.baidu.com/ --- 域名 --- 域名解析 --- IP地址 http的端口号为80端口,https的端口号为443 url为统一资源定位符。CSDNhttps://mp.csdn.net/mp_blog/creation/editor

【Python编程】Linux创建虚拟环境并配置与notebook相连接

1.创建 使用 venv 创建虚拟环境。例如,在当前目录下创建一个名为 myenv 的虚拟环境: python3 -m venv myenv 2.激活 激活虚拟环境使其成为当前终端会话的活动环境。运行: source myenv/bin/activate 3.与notebook连接 在虚拟环境中,使用 pip 安装 Jupyter 和 ipykernel: pip instal

黑神话,XSKY 星飞全闪单卷性能突破310万

当下,云计算仍然是企业主要的基础架构,随着关键业务的逐步虚拟化和云化,对于块存储的性能要求也日益提高。企业对于低延迟、高稳定性的存储解决方案的需求日益迫切。为了满足这些日益增长的 IO 密集型应用场景,众多云服务提供商正在不断推陈出新,推出具有更低时延和更高 IOPS 性能的云硬盘产品。 8 月 22 日 2024 DTCC 大会上(第十五届中国数据库技术大会),XSKY星辰天合正式公布了基于星