Test Report SylixOS GUI(Qt) 性能 TR0010010001 V1.00 Date: 2015/12/03 类别内容关键词 SylixOS Qt qtperf 利用 qtperf 测试 SylixOS 的 GUI Qt 的各种类型窗口部件摘要的性能
SylixOS GUI(Qt) 性能 修订历史版本 日期 原因 V1.00 2014/09/17 创建文档 V1.10 2015/07/24 使用 OK335xS 重新测试 V1.11 2016/11/29 修改文档模板 i
SylixOS GUI(Qt) 性能 目录 1. 测试目的... 1 2. 测试工具... 1 2.1 硬件平台... 1 2.2 操作系统... 1 2.3 编译器... 1 2.4 Qt SDK... 2 3. 测试方法... 2 4. Linux 测试结果... 3 5. SylixOS 测试结果... 4 5.1 arm-sylixos-qt-4.8.6 SDK... 4 5.2 armv7-sylixos-qt-4.8.6 SDK... 4 6. 测试结果汇总与对比... 5 7. 测试结论... 6 i
SylixOS GUI(Qt) 性能 1. 测试目的 测试 SylixOS 的 GUI Qt 的各种类型窗口部件的性能, 特别是 QPainter 绘制直线 椭圆 文本 图片的性能 2. 测试工具 2.1 硬件平台 测试硬件平台使用保定飞凌嵌入式技术有限公司设计 生产和发行销售的 OK335xS 型 开发板, 如图 2.1 所示 图 2.1 OK335xS 开发板关键硬件参数如下 : CPU:TI 公司的 AM335x 芯片 (ARM Cortex-A8 核心,ARMv7A 体系结构, 运行主频为 800MHz, 带有 32KB 的 D-Cache 和 32KB 的 I-Cache 及 256KB 的 L2-Cache) 内存 :512MB DDR2 FLASH 存储 :256M SLC NAND Flash 显示屏 :7 英寸的 LCD, 分辨率为 800*480, 刷新率为 65Hz 2.2 操作系统测试硬件平台运行的操作系统为 SylixOS,libsylixos 的版本为 1.2.0-rc1 GEMINI(b), bspam335x 的版本为 1.1.0 libsylixos 关闭了对 MONITOR 和 SMP 支持 编译 libsylixos 和 bspam335x 时, 编译参数中的 cpu 参数为 -mcpu=cortex-a8, 优化参数为 -O2, 即使用 O2 等级优化 对比测试操作系统为厂家配套的 Linux, 版本为 3.2.0 2.3 编译器 SylixOS 及相关软件使用 RealCompiler 编译器编译,GCC 版本信息如下 : arm-sylixos-eabi-gcc: gcc version 4.9.3 20150303 (release) [ARM/embedded-4_9-branch revision 221220] (SylixOS Toolchain for ARM Embedded 1
SylixOS GUI(Qt) 性能 Processors) Linux 及相关软件使用厂家配套的编译器编译,GCC 版本信息如下 : arm-arago-linux-gnueabi-gcc: gcc version 4.5.3 20110311 (prerelease) (GCC) 2.4 Qt SDK Linux 使用厂家配套的 Qt-4.8.5 SDK, 编译选项 : 默认的 cpu 和 arch + -O2 由于 SylixOS 在 ARM 处理器上有两个 Qt SDK 针对 ARM9 ARM11 处理器的 arm-sylixos-qt-4.8.6 SDK 和针对 Cortex-A 系列处理器的 armv7-sylixos-qt-4.8.6 SDK arm-sylixos-qt-4.8.6 SDK 编译选项 : arm-sylixos-eabi-gcc -march=armv4 -mno-unaligned-access -O2 armv7-sylixos-qt-4.8.6 SDK 编译选项 : arm-sylixos-eabi-gcc -march=armv7-a -mfloat-abi=softfp -mfpu=neon -mno-unaligned-access -O2 3. 测试方法 使用第三方的测试程序 qtperf 来测试 Qt 的性能,qtperf 是 GTK+ 性能测试工具 gtkperf 的 Qt 移植版本,qtperf 的官网是 :https://github.com/shuttie/qtperf qtperf 支持的测试项目如表 3.1 所示 表 3.1 qtperf 测试项目 测试项目 测试项目描述 QLineEdit 测试窗口部件 QLineEdit( 行编辑器 ) 的文本在 Test String 和 Longer test string 之间变换的运行时间 QComboBox 窗口部件 QComboBox( 组合框 ) 包含 10 个选择 Selection 1... Selection 10 测试开启和关闭组合框的运行时间 QComboBoxEntry 可编辑窗口部件 QComboBox( 组合框 ) 包含 10 个选择 Selection 1... Selection 10 测试开启和关闭组合框的运行时间 QSpinBox 测试窗口部件 QSpinBox 以 1 为步进值增加 100 的运行时间 QProgressBar 测试窗口部件 QProgressBar( 进度条 ) 值以 1 为步进值从 0 增加到 100 的运行 时间 QPushButton 测试窗口部件 QPushButton( 按钮 ) 状态按下 / 弹起的切换时间 QCheckbox 测试窗口部件 QCheckbox( 复选框 ) 选中 / 不选中的切换时间 QRadioButton 测试同一组内两个窗口部件 QRadioButton( 单选框 ) 交替选中的切换时间 QTextEdit add text 测试窗口部件 QTextEdit( 文本编辑器 ) 追加文本 Future is Open. 的时间 QTextEdit scroll 测试窗口部件 QTextEdit( 文本编辑器 ) 滑动 100 个像素的运行时间 QPainter lines 测试在窗口部件 QPainter 上利用随机位置和长度和颜色绘制 1000 条直线的时 间 QPainter circles 测试在窗口部件 QPainter 上利用随机位置和大小及颜色绘制 1000 个填充椭圆的 时间 QPainter text 测试在窗口部件 QPainter 上利用随机位置和颜色绘制 100 个加粗文本 Future is Open. 的时间 2
SylixOS GUI(Qt) 性能 QPainter pixmap 测试在窗口部件 QPainter 上利用随机位置绘制 10 个图片 Duck.png 的时间 下面是 qtperf 在 windows 上运行时的一些截图 : 分别移植 qtperf4 到 SylixOS 和 Linux 并全屏运行, 将得到两份测试结果, 然后对测试结果进行汇总 对比和分析 移植好的 qtperf4 代码托管在 github 上 :https://github.com/sylixos/qtperf 4. Linux 测试结果 qtperf 编译参数如下 : arm-arago-linux-gnueabi-gcc -mcpu=cortex-a8 -mfloat-abi=softfp -mfpu=vfpv3 -O2 qtperf 测试结果输出如下 : root@ok335x:/home/forlinx/qtperf#./qtperf4 -qws & [1] 1545 root@ok335x:/home/forlinx/qtperf# QLineEdit - 0.755 s QComboBox - 4.08 s QComboBoxEntry - 4.397 s QSpinBox - 0.472 s 3
SylixOS GUI(Qt) 性能 QProgressBar - 0.754 s QPushButton - 0.333 s QCheckbox - 0.218 s QRadioButton - 0.564 s QTextEdit add text - 2.98 s QTextEdit scroll - 0.462 s QPainter lines - 5.997 s QPainter circles - 5.947 s QPainter text - 6.363 s QPainter pixmap - 6.224 s Total: 39.546001 s 5. SylixOS 测试结果 5.1 arm-sylixos-qt-4.8.6 SDK qtperf 编译参数如下 : arm-sylixos-eabi-gcc -march=armv4 -mno-unaligned-access -O2 qtperf 测试结果输出如下 : [root@sylixos_station:/apps/qtperf]#./qtperf4 -qws & [root@sylixos_station:/apps/qtperf]# Connected to SylixOS FrameBuffer server: 800 x 480 x 32 282x169mm (72x72dpi) Corrupt calibration data QSylixOSInputMouseHandler: connected. QSylixOSInputKeyboardHandler: connected. QLineEdit - 0.943 s QComboBox - 5.179 s QComboBoxEntry - 5.723 s QSpinBox - 0.649 s QProgressBar - 0.955 s QPushButton - 0.418 s QCheckbox - 0.313 s QRadioButton - 0.781 s QTextEdit add text - 2.871 s QTextEdit scroll - 0.482 s QPainter lines - 4.633 s QPainter circles - 4.598 s QPainter text - 5.089 s QPainter pixmap - 4.677 s Total: 37.310997 s 5.2 armv7-sylixos-qt-4.8.6 SDK qtperf 编译参数如下 : arm-sylixos-eabi-gcc -march=armv7-a -mfloat-abi=softfp -mfpu=neon -mno-unaligned-access -O2 4
SylixOS GUI(Qt) 性能 qtperf 测试结果输出如下 : [root@sylixos_station:/apps/qtperf]#./qtperf4 -qws & [root@sylixos_station:/apps/qtperf]# Connected to SylixOS FrameBuffer server: 80 0 x 480 x 32 282x169mm (72x72dpi) Corrupt calibration data QSylixOSInputMouseHandler: connected. QSylixOSInputKeyboardHandler: connected. QLineEdit - 0.612 s QComboBox - 3.506 s QComboBoxEntry - 3.726 s QSpinBox - 0.367 s QProgressBar - 0.568 s QPushButton - 0.258 s QCheckbox - 0.185 s QRadioButton - 0.484 s QTextEdit add text - 2.434 s QTextEdit scroll - 0.317 s QPainter lines - 4.325 s QPainter circles - 4.279 s QPainter text - 4.7 s QPainter pixmap - 4.301 s Total: 30.062002 s 6. 测试结果汇总与对比 Linux 和 SylixOS 的 qtperf 测试结果汇总如表 6.1 所示 表 6.1 qtperf 测试结果 测试项目 Linux arm-sylixos-qt-4.8.6 armv7-sylixos-qt-4.8.6 QLineEdit 0.755 s 0.943 s 0.612 s QComboBox 4.08 s 5.179 s 3.506 s QComboBoxEntry 4.397 s 5.723 s 3.726 s QSpinBox 0.472 s 0.649 s 0.367 s QProgressBar 0.754 s 0.955 s 0.568 s QPushButton 0.333 s 0.418 s 0.258 s QCheckbox 0.218 s 0.313 s 0.185 s QRadioButton 0.564 s 0.781 s 0.484 s QTextEdit add text 2.98 s 2.871 s 2.434 s QTextEdit scroll 0.462 s 0.482 s 0.317 s QPainter lines 5.997 s 4.633 s 4.325 s QPainter circles 5.947 s 4.598 s 4.279 s QPainter text 6.363 s 5.089 s 4.7 s QPainter pixmap 6.224 s 4.677 s 4.301 s Total 39.546001 s 37.310997 s 30.062002 s 5
SylixOS GUI(Qt) 性能 由表 6.1 可以看出,armv7-sylixos-qt-4.8.6 SDK 的性能最好,arm-sylixos-qt-4.8.6 SDK 依靠更优秀的 mem 类函数在总体性能上比 Linux Qt-4.8.5 SDK 稍优, 但 Linux Qt-4.8.5 SDK 大部分测试项目性能要优于 arm-sylixos-qt-4.8.6 SDK 7. 测试结论 在测试 arm-sylixos-qt-4.8.6 SDK 和 armv7-sylixos-qt-4.8.6 SDK 时, 使用了相同的运行环境 ( 操作系统镜像 libvpmpdm.so libcextern.so xsiipc.ko xinput.ko 均相同 ), 所以 armv7-sylixos-qt-4.8.6 SDK 的性能优于 arm-sylixos-qt-4.8.6 SDK 的原因在于同样的 Qt-4.8.6 代码被编译为更有高级的指令集 (ARMv7A 和 VFP 及 NEON) armv7-sylixos-qt-4.8.6 SDK 的性能最好, 建议客户在 Cortex-A 系列处理器上使用 armv7-sylixos-qt-4.8.6 SDK 6