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

Startup 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供其使用。

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.

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使用了新配置工具

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长期支持版之性能改善 - 陈德鹏的博文...相关推荐

  1. 计算机领域澳大利亚成就,科学网—【编委特写】澳洲Top5科学家:韩清龙 最新成果 - 陈培颖的博文...

    ​转眼又到一年丰收时,2019年,IJAC喜讯连连.全面开花!迄今已连续3次.11年获"中国科技期刊影响力提升计划"."中国科技期刊卓越行动计划"项目支持,资助 ...

  2. linux内核 lts长期演进,Linux Kernel 4.19 将成为下一个LTS(长期支持)系列

    最近Linux内核开发人员和维护人员Greg Kroah-Hartman透露,Linux Kernel 4.19将下一个长期支持的Linux内核系列. 现在Linux Kernel 4.17已经达到使 ...

  3. gpt efi win7 linux,科学网—UEFI+GPTSSD+HDD 成功安装win10+Centos linux7 过程 - 陈长云的博文...

    主机为:Dell Precision T7910台式工作站  SSD + HDD 双硬盘 1.必备工具 ① Disk Genious ② Win10系统(光盘和U盘,我用的是U盘),网上可以下载 cn ...

  4. openacc的Linux安装教程,科学网—opensuse 13.1 系统 openACC编译器使用及GPU并行编程环境配置 - 马小军的博文...

    本文讲述opensuse13.1系统openACC编译器使用及GPU并行编程环境配置. 这里以笔记本显卡驱动为NVIDIA为例 在安装前,请确保系统已经安装kernel-devel ,kernel-s ...

  5. c语言 宏 变长参数,科学网—C/C++中处理变长参数函数(Variadic Function)的几个宏 - 彭彬的博文...

    近日在模式中进行非线性方程组求解时遇到变长参数函数的问题,以前从来没有自己写过变长参数的函数,于是补了一下课,将近日对该小问题的学习和理解整理如下. 一.变长参数函数(variadic functio ...

  6. 2018ei期刊目录计算机,科学网—2018年智能计算与信息系统国际会议(ICIS2018)征文期刊EI检索 - 周建国的博文...

    2018年第二届智能计算与信息系统国际会议(2018 the 2nd international conference on intelligent computing andinformation ...

  7. 哨兵二号数据offline_科学网—利用ENVI 5.3读取哨兵2号(Sentinel-2)L1C数据 - 朱永超的博文...

    2016年12月6号,欧空局修改了哨兵2号(S2)数据的命名规则,这导致ENVI 5.3仅能打开此前获取的S2数据,而之后的数据仅能在ENVI最新版5.4中打开,参见:https://yceo.yal ...

  8. perl mysql 数据推拉_科学网—从MySQL数据库中提取序列并进行引物设计的perl脚本 - 闫双勇的博文...

    利用MySQL数据库来储存序列,通过perl脚本获取序列,并进行引物设计.当然除了引物设计干其它事情也是可以的. 将FASTA文件导入MySQL数据库的方法: bp_seqfeature_load.p ...

  9. 差分电荷密度怎么画_科学网—差分电荷密度图、电荷局域密度图(ELF)的画法及分析 - 叶小球的博文...

    关注: 1) 电荷密度图.差分电荷密度图及ELF的原理 2)  计算方法及参数设置 影响ELF准确性的参数有哪些?  在计算效率与准确性/精确性之间权衡. Ecut, KPOINTS? 3)  画法及 ...

  10. python牛顿法解非线性方程组_科学网—求解多元非线性方程组F(x)=0的Newton-Raphson方法及其MATLAB实现 - 王福昌的博文...

    科学网对公式支持不太好,在博客园有相同博文 牛顿迭代法可以推广到多元非线性方程组 $boldsymbol{F}(boldsymbol{x})=boldsymbol{0}$的情况,称为牛顿-- 拉夫逊方 ...

最新文章

  1. 中国高校4篇研究今日同时登上Nature!清华北大上交浙工大等在列
  2. JSP中文乱码问题终极解决方案
  3. python实现排序_python实现以及所有排序大总结【转】
  4. 学习Vue的一些看法
  5. TensorFlow高阶 API: keras教程-使用tf.keras搭建mnist手写数字识别网络
  6. 51nod1675-序列变换【莫比乌斯反演】
  7. 将JAR依赖项添加到Eclipse插件Maven Tycho构建
  8. ReactJS入门学习一
  9. 初次注册使用Tushare Pro报错问题
  10. android 模拟器 电脑配置,手游安卓模拟器多开对电脑配置要求与占用浅谈
  11. 二阶常系数微分方程求解步骤
  12. python数据框列命名_python-按列名称处理pandas数据框值
  13. 微信订阅号和公众号的区别
  14. Gartner发布2021年新兴技术成熟度曲线,三大新兴技术趋势主题
  15. 非常实用全面的风水知识
  16. Extract - 凤凰牌老熊-现代支付系统设计
  17. 汉诺塔IV,汉诺塔V
  18. PLC低频测速(T法测速)
  19. 【机器学习笔记14】softmax多分类模型【下篇】从零开始自己实现softmax多分类器(含具体代码与示例数据集)
  20. Hadoop期末总结

热门文章

  1. 什么是MES,什么是WMS,MES与WMS有什么区别?
  2. easyui-datagrid去掉点击出现行背景的事件
  3. 美国计算机读研准备什么,准备买电脑,各位有什么好介绍?(美国)
  4. android Studio导出的apk解析包时出错
  5. 个人日常linux常用命令(一)查看进程和磁盘使用情况
  6. 小白成长建议(1)-深思熟虑 云层
  7. 结构分析软件:2D Frame Analysis 7.2.6 Crack
  8. iOS APP上架因为PLA 1.2被拒解决办法
  9. 程序应该保护好自己的身体
  10. springboot校园医院预约挂号系统-计算机毕设 附源码32236