[Development] Perf about loading one 240x320 png image

Diego Iastrubni diegoiast at gmail.com
Sun Sep 30 11:37:00 CEST 2012


On Sat, Sep 29, 2012 at 7:21 AM, <song.7.liu at nokia.com> wrote:

>  Hi,****
>
> ** **
>
> I am testing the image loading performance in Qt5, that the image with
> different location (qt resource or file system) and using QImage or QPixmap.
> ****
>
> ** **
>
> Testing is based on a low end devices, and the result is shared as bellow:
> ****
>
> ** **
>
> Loading perf (240x320 png image)****
>
> from resource****
>
> from file system****
>
> QImage****
>
> 1.135s****
>
> 1.132s****
>
> QPixmap****
>
> 1.146s****
>
> 1.182s****
>
> ** **
>
> It seems the performance is really bad,,, does anyone have some insight
> about which place can be the bottleneck ?****
>
> **
>

My experience is with Qt4... but I do see that QFile was slow for me. I
needed to parse a simple text file from a real disk (~10mb size, simple
state machine, no regex, application run several times for disk IO to get
working thus reducing the impact of HW). My first try was using
QFile::readLine, and using QString. I then ported it to use ANSI C and
char* (only for the parsing, the rest of the project was still using Qt4
classes).

This simple refactoring (QFile -> fopen()) changed loading time (on
windows):
   file1.txt: 515msec to 230msec
   file2.txt: 420msec to 155msec

On linux (the same HW, double booting) the Qt QIO classes were not that
slow, but the standard C functions were also faster.

Is anyone seeing similar things?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120930/31787be6/attachment.html>


More information about the Development mailing list