SlideShare une entreprise Scribd logo
1  sur  67
Télécharger pour lire hors ligne
Optimizing Performance in
     Qt Applications
                            11/16/09
Introduction

• Bjørn Erik Nilsen
  – Software Engineer / Qt Widget Team

  – The architect behind Alien Widgets

  – Rewrote the Backing Store for Qt 4.5

  – One of the guys implementing
    WidgetsOnGraphicsView

  – Author of QMdiArea/QMdiSubWindow

  – Author of QGraphicsEffect/QGraphicsEffectSource

                                                      2
Agenda

• Why Performance Matters

• Performance Improvements in Qt 4.6

• How You Can Improve Performance




                                       3
Why Performance Matters

• Attractive to users

• Looks more professional

• Help you get things done more efficiently

• Keeps the flow




                                              4
Why Performance Matters
• An example explains more than a thousand words




                                                   5
Why Performance Matters

• Performance is more important than ever before
   – Dynamic user interfaces

• Qt Everywhere
  – Desktop
  – Embedded platforms with limited hardware

• We cannot just buy better hardware anymore

• Clock speed vs. number of cores



                                                   6
Why Performance Matters

• Not all applications can take advantage of
  multiple cores

• And some will actually run slower:
   – Each core in the processor is slower

   – Most applications not programmed to be multi-
     threaded

• Multi-core crisis?


                                                     7
Agenda

• Why Performance Matters

• Performance Improvements in Qt 4.6

• How You Can Improve Performance




                                       8
Performance Improvements in Qt 4.6
• We continuously strive to optimize the performance

   – QWidget painting performance, for example:




   – Qt 4.6 no exception!
                                                       9
Performance Improvements in Qt 4.6


             QtOpenGL              QtGui


                                            QtOpenVG
     QtSvg
                        QtScript


       QtCore                              QtWebKit


                         QtNetwork




                                                       10
Performance Improvements in Qt 4.6
• Graphics View

   – New update mechanism                   QtGui

   – New painting algorithm

   – New scene indexing

   – Reduced QTransform/QVariant/floating point
    overhead

• QPixmapCache

   – Extended with an int based API

                                                    11
Performance Improvements in Qt 4.6
• Item Views
   – Item selection                      QtGui
   – Drag 'n' drop
   – QTableView and QHeaderView

• QTransform
   – fromTranslate/fromScale
   – mapRect for projective transforms

• QRegion
   – No longer a GDI object on Windows


                                                 12
Performance Improvements in Qt 4.6
• QObject
   – Destruction                            QtCore
   – Connect and disconnect
   – Signal emission

• QVariant
   – Construction from float and pointers

• QIODevice
   – Less (re)allocations in readAll()




                                                     13
Performance Improvements in Qt 4.6
• QNetworkAccessManager
   – HTTP back-end                           QtNetwork

• QHttpNetworkConnectionChannel
   – Pipelining HTTP requests (off by default)

• QHttpNetworkConnection
   – Increased the number of concurrent connections

• QLocalSocket
   – New Windows implementation
   – Major performance improvements


                                                         14
Performance Improvements in Qt 4.6


                                             QtScript




• QtScript now uses JavaScriptCore as the back-end!
   – Still the same API, but with JSC performance




                                                        15
Performance Improvements in Qt 4.6
• New OpenGL 2.x paint engine

• General improvements          QtOpenGL

   – Clipping
  – Text drawing




                                           16
Performance Improvements in Qt 4.6
• New OpenVG paint engine                      New module!

   – Uses Khronos EGL API                      QtOpenVG
   – Configure Qt with “-openvg”

• Support for hardware-accelerated 2D vector graphics on:
   – Embedded, mobile and consumer electronic devices
   – Desktop

• More info: http://labs.trolltech.com/blogs




                                                             17
Performance Improvements in Qt 4.6


                                          Embedded


• Improved support for DirectFB
   – Enabling hardware graphics acceleration on
     embedded platforms

• Maemo Harmattan optimizations




                                                     18
Agenda

• Why Performance Matters

• Performance Improvements in Qt 4.6

• How You Can Improve Performance




                                       19
How You Can Improve Performance
• Theory of Constraints (TOC) by Eliyahu M. Goldratt
• The theory is based on the idea that in any complex
  system, there is usually one aspect of that system that
  limits its ability to achieve its goal or optimal
  functioning. To achieve any significant improvement of
  the system, the constraint must be identified and
  resolved.

• Applications will perform as fast as their bottlenecks




                                                            20
Theory of Constraints
• Define a goal:
   – For example: This application must run at 30 FPS

• Then:
   1) Identify the constraint
   2) Decide how to exploit the constraint
   3) Improve
   4) If goal not reached, go back to 1)
   5) Done




                                                        21
Identifying hot spots (1)
• The number one and most important task

• Make sure you have plausible data

• Don't randomly start looking for slow code paths!
   – An O(n2) algorithm isn't necessarily bad
   – Don't spend time on making it O(n log n) just for fun

• Don't spend time on optimizing bubble sort




                                                             22
Identifying hot spots (1)
                      • “Bottlenecks occur in
                        surprising places, so
                        don't try second guess
                        and put in a speed hack
                        until you have proven
                        that is where the
                        bottleneck is” -- Rob Pike



                                                     23
Identifying hot spots (1)
• The right approach for identifying hot spots:

   – Any profiler suitable for your platform
      • Shark (Mac OSX)
      • Valgrind (X11)
      • Visual Studio Profiler (Windows)
      • Embedded Trace Macrocell (ETM) (ARM devices)
• NB! Always profile in release mode




                                                       24
Identifying hot spots (1)
• Run application: “valgrind --tool=callgrind ./application”

• This will collect data and information about the program

• Data saved to file: callgrind.out.<pid>

• Beware:
   – I/O costs won't show up
   – Cache misses (--simulate-cache=yes)
• The next step is to analyze the data/profile
• Example



                                                               25
Identifying hot spots (1)
• Profiling a section of code (run with “–instr-atstart=no”):


              #include<BbrValgrind/callgrind.h>

              int myFunction() const
              {
                 CALLGRIND_START_INSTRUMENTATION;

                  int number = 10;
                  ...

                  CALLGRIND_STOP_INSTRUMENTATION;
                  CALLGRIND_DUMP_STATS;

                  return number;
              }



                                                                26
Identifying hot spots (1)
• When a hot-spot is identified:
  – Look at the code and ask yourself: Is this the right
    algorithm for this task?

• Once the best algorithm is selected, you can exploit the
  constraint




                                                             27
How to exploit the constraint (2)
• Optimize
   – Design level
   – Source code level
   – Compile level

• Optimization trade-offs:
   – Memory consumption, cache misses
   – Code clarity and conciseness




                                        28
How to exploit the constraint (2)
                     • “Any intelligent fool can
                       make things bigger,
                       more complex, and more
                       violent. It takes a touch
                       of genius – and a lot of
                       courage – to move in the
                       opposite direction.”
                       --Einstein

                                                   29
How to exploit the constraint (2)
• Wouldn't it be great to have a cross-platform tool to
  measure performance?




                                                          30
QTestLib
• Say hello to QBENCHMARK

• Extension to the QTestLib framework

• Cross-platform

• Straight forward: QBENCHMARK { <code here> }

• Code will then be measured based on
   – Walltime (default)
   – CPU tick counter (-tickcounter)
   – Valgrind/Callgrind (-callgrind)
   – Event counter (-eventcounter)

                                                 31
QTestLib
• Let's create a benchmark

• Run with ./mytest -xml -o results.xml

• git clone git://gitorious.org/qt-labs/qtestlib-tools.git

• Visualize with
   – Graph (generatereport results.xml)
   – BMCompare (bmcompare results1.xml results2.xml)

• Now that we have tool, it is easier to measure and
  decide which algorithm to use


                                                             32
How to exploit the constraint (2)
• General tricks:
   – Caching
   – Delay a computation until the result is required
   – Reduce computation in tight loops
   – Compiler optimizations

• Optimization Techniques for Qt:
   – Choose the right container
   – Use implicit data sharing efficiently
   – Discover the magic flags



                                                        33
Implicit data sharing in Qt
• Maximize resource usage and minimize copying

    Object obj0; // Creates ObjectData

    // Copies (share the same data)
    Object obj1, obj2, obj3 = obj0;
                                             Object 1


   Object 0                  ObjectData      Object 2


                                             Object 3

                                          Shallow copies




                                                           34
Implicit data sharing in Qt
• Data is only copied if someone modifies it:


                                                Deep copy

                     ObjectData                  Object 1


    Object 0         ObjectData                  Object 2


                                                 Object 3

                                           Shallow copies




                                                            35
Implicit data sharing in Qt
• How to avoid deep-copy:
   – Only use const operators and functions if possible
   – Be careful with the foreach keyword
• For classes that are not implicitly shared:
   – Always pass them around as const references
   – Passing const references is a good habit in any case
• Examples




                                                            36
Implicit data sharing in Qt
            Original                            Optimized

T *readOnly = list[index];           T *readOnly = list.at(index);


QList<T>::iterator i;                QList<T>::const_iterator i;
i = list.begin();                    i = list.constBegin();


foreach (QString s, strings)         foreach (const QString &s, strings)


                NB! QTransform is not implicitly shared!



void foo(QTransform t);              void foo(const QTransform &t);


                                                                           37
Implicit data sharing in Qt
• See the “Implicitly Shared Classes” documentation for a
  complete list of implicitly shared classes in Qt

• http://doc.trolltech.com/4.6-snapshot/shared.html

• Note: All Qt containers are implicitly shared




                                                            38
Qt Containers

                QLinkedList

    QList
                               QVector


                                         QSet

      QStack
                      QQueue


                                         QMultiHash

   QMap                         QHash
               QMultiMap



                                                      39
Qt Containers




                              QHash      QMap




                          QMultiHash   QMultiMap
 Associative Containers




                                                   40
Qt Containers
                            QSet




                           QList   QVector

       QLinkedList


                         QQueue    QStack
 Sequential Containers




                                             41
Qt Containers




                          vs
                          QList   QVector

       QLinkedList


                         QQueue   QStack
 Sequential Containers




                                            42
QVector<T>
• Items are stored contiguously in memory

• One block of memory is allocated:


    QBasicAtomicInt    int     int   uint        T               T

         ref          alloc   size   flags   array[0] ... array[alloc - 1]
    QVectorTypedData<T>




               d
       QVector<T>



                                                                             43
QVector<T>
• Reserves space at the end

• Growth strategy depends on the type T
   – Movable types: realloc by increments of 4096 bytes
   – Non-movable types: 50% increments
• What is a movable type?
  – Primitive types: bool, int, char, enums, pointers, …
   – Plain Old Data (POD) with no constructor/destructor
   – Basically everything that can be moved around in
     memory using memcpy() or memmove()
   – Good article: http://www.ddj.com/cpp/184401508


                                                           44
Movable types
• User-defined classes are treated as non-movable by
  default

• Oh no!

• Have no fear, Q_DECLARE_TYPEINFO is here

• You can tell Qt that your class is a:
   – Q_PRIMITIVE_TYPE: POD with no constr./destr.
   – Q_MOVABLE_TYPE: has constr./destr., but can be
     moved in memory using memcpy()/memmove()



                                                       45
Movable types (Q_PRIMITIVE_TYPE)



    struct Point2D
    {
       int x;
       int y;
    };

    Q_DECLARE_TYPEINFO(Point2D, Q_PRIMITIVE_TYPE);




                                                     46
Movable types (Q_MOVABLE_TYPE)

     class Point2D
     {
     public:
        Point2D() { data = new int[2]; }
        Point2D(const Point2D &other) { … }
        ~Point2D() { delete [] data; }

       Point2D &operator=(const Point2D &other) { … }

       int x() const { return data[0]; }
       int y() const { return data[1]; }

     private:
        int *data;
     };

     Q_DECLARE_TYPEINFO(Point2D, Q_MOVABLE_TYPE);

                                                        47
QVector<T>
• Insertion in the middle:
   – Movable type: memmove()
  – Non-movable type: operator=()

            1



        0   1    2    3    4    5   6




        0   1    2    3    4    5   6   7




                                            48
QList<T>
• Two representations

• Array of pointers to items on the heap (general case)


   QBasicAtomicInt    int   int   int   uint       void *       void *

        ref          alloc begin end flags array[0] ... array[alloc - 1]
   QListData::Data


                                               T            T

              d
      QList<T>



                                                                           49
QList<T>
• Special case: T is movable and sizeof(T) <= sizeof(void *)

• Items are stored directly (same as QVector)


   QBasicAtomicInt    int   int   int   uint   T                T

        ref          alloc begin end flags array[0] ... array[alloc - 1]
   QListData::Data




              d
      QList<T>



                                                                           50
QList<T>
• Reserves space at the beginning and at the end

• Benefits of reserving space at the beginning
   – Prepending an item usually takes constant time
   – Removing the first item usually takes constant time
   – Faster insertion




                                                           51
QVector<T> vs. QList<T>
• QList expands to less code in the executable

• For most purposes, QList is the right class to use

• If all you do is append(), use QVector
   – Use reserve() if you know the size in advance
   – Also consider QVarLengthArray or plain C array

• When T is movable and sizeof(T) <= sizeof(void *)
  – Almost no difference, except that QList provides faster
    insertions/removals in the first half of the list

• (Constant time insertions in the middle: Use QLinkedList)

                                                              52
General Qt Container Advices
• Avoid deep copies, e.g:
   – Use at() rather than operator[]
   – constData()/constBegin()/constEnd()
   – Basically: limit usage of non-const functions

• When you know the size in advance:
  – Use reserve()

• Let Qt know whether your class is movable or not
   – Q_DECLARE_TYPEINFO

• Choose the right container for the right circumstance


                                                          53
General Painting Optimizations
• Prefer QPixmap over QImage (if possible)
   – QPixmap is accelerated
   – QPixmap caches information about the pixels

• Avoid QPixmap/QImage::setAlphaChannel()
   – Use QPainter::setCompositionMode instead

• Avoid QPixmap/QImage::transformed()
   – Use QPainter::setWorldTransform instead
• If you for sure know the image has alpha:
   – Qt::NoOpaqueDetection (QPixmap::fromImage)


                                                   54
General Painting Optimizations
                      Original


         int width = image.width();
         int height = image.height();

         for (int y = 0; y < height; ++y) {
            for (int x = 0; x < width; ++x) {
               QRgb pixel = image.pixel(x, y);
               …
            }
         }



               NB! Image is 32 bit



                                                 55
General Painting Optimizations
                           Optimized


  int width = image.width();
  int height = image.height();

  for (int y = 0; y < height; ++y) {
     QRgb *line = reinterpret_cast<QRgb *>(image.scanLine(y));
     for (int x = 0; x < width; ++x) {
        QRgb pixel = line[x];
        …
     }
  }




                                                                 56
General Painting Optimizations
                     Even more optimized


   int numPixels = image.width() * image.height();
   QRgb *pixels = reinterpret_cast<QRgb *>(image.bits());

   for (int i = 0; i < numPixels; ++i) {
        QRgb pixel = pixels[i];
         …
      }
   }




                                                            57
General Painting Optimizations
           Original                              Optimized


MyWidget::paintEvent(...)              MyWidget::paintEvent(...)
{                                      {
  QPainter painter(this);                QPainter painter(this);
  painter.fillRect(rect(), Qt::red);     painter.fillRect(rect(), Qt::red);
}                                      }

int main(int argc, char **argv)        int main(int argc, char **argv)
{                                      {
   ...                                    ...
   MyWidget widget;                       MyWidget widget;
   ...                                    widget.setAttribute(
}                                         Qt::WA_OpaquePaintEvent);
                                          ...
                                       }


                                                                              58
General Painting Optimizations
            Original                        Optimized

painter.drawLine(line1);         QLine lines[3];
painter.drawLine(line2);         ...
painter.drawLine(line3);         painter.drawLines(lines, 3);


painter.drawPoint(point1);       QPoint points[3];
painter.drawPoint(point2);       ...
painter.drawPoint(point3);       painter.drawPoints(points, 3);


QString key(“abcd”);             QPixmapCache::Key key;
QPixmapCache::insert(key, pm);   key = QPixmapCache::insert(pm);
QPixmapCache::find(key, pm);     pm = QPixmapCache::find(key);



                                                                   59
Other Optimizations
              Original                             Optimized

const QString s = s1 + s2 + s3;         #include <QStringBuilder>
                                        ...
    #define QT_USE_FAST_CONCATENATION   const QString s = s1 % s2 % s3;
    #define QT_USE_FAST_OPERATOR_PLUS



QTransform xform = a.inverted();        QTransform xform = b;
xform *= b.inverted();                  xform *= a;
                                        xform = xform.inverted();


foreach (const QString &s, slist) {     foreach (const QString &s, slist) {
   if (s.size() < 5)                       if (s.size() < 5)
       continue;                               continue;
   const QString m = s.mid(2, 3);          QStringRef m(&s, 2, 3);
   if (m == magicString)                   if (m == magicString)
       doMagicStuff();                         doMgicStuff();
}                                       }
                                                                              60
Other Optimizations
            Original                              Optimized

qFuzzyCompare(opacity+1, 1));          qFuzzyIsNull(opacity));


int nRects = qregion.rects().size();   int nRects = qregion.numRects();

if (expensive() && cheap())            if (cheap() && expensive())


#button1 { background:red }             #button1,
#button2 { background:red }             #button2 { background:red }

*[readOnly=”1”] { color:blue }          /* Only QLineEdit can possibly be
                                           read-only in my application
                                        */
                                        QLineEdit[readOnly = “1”]
                                        { color:blue }


                                                                            61
Graphics View Optimizations
• Viewport update modes

• Scene index
   – BSP tree index
   – No index

• Avoid QGraphicsScene::changed signal

• QGraphicsScene::setSceneRect

• Cache modes
   – Device coordinates
   – Item coordinates
• OpenGL viewport
                                         62
Platform Specific Optimizations
• Link time optimization LTCG (Windows only)
   – Approx. 10%-15% speedup
   – Configure Qt with “-ltcg”

• Don't use explicit double arithmetic
   – qreal is float on embedded (QWS)
   – 100 / 2.54 → 100 / qreal(2.54)

• It's time time to take advantage of what we have
  learned

• Let's do some real optimizations!

                                                     63
Theory of Constraints
• Define a goal:
   – For example: This application must run at 30 FPS

• Then:
   1) Identify the constraint
   2) Decide how to exploit the constraint
   3) Improve
   4) If goal not reached, go back to 1)
   5) Done




                                                        65
Agenda

• Why Performance Matters

• Performance Improvements in Qt 4.6

• How You Can Improve Performance




                                       66
Questions?

Contenu connexe

Tendances

Android kotlin coroutines
Android kotlin coroutinesAndroid kotlin coroutines
Android kotlin coroutinesBipin Vayalu
 
Introduction to kotlin coroutines
Introduction to kotlin coroutinesIntroduction to kotlin coroutines
Introduction to kotlin coroutinesNAVER Engineering
 
Qt for Beginners Part 3 - QML and Qt Quick
Qt for Beginners Part 3 - QML and Qt QuickQt for Beginners Part 3 - QML and Qt Quick
Qt for Beginners Part 3 - QML and Qt QuickICS
 
Using Multi-Touch and Gestures with Qt
Using Multi-Touch and Gestures with QtUsing Multi-Touch and Gestures with Qt
Using Multi-Touch and Gestures with Qtaccount inactive
 
State of the Art OpenGL and Qt
State of the Art OpenGL and QtState of the Art OpenGL and Qt
State of the Art OpenGL and QtICS
 
Best Practices in Qt Quick/QML - Part 1 of 4
Best Practices in Qt Quick/QML - Part 1 of 4Best Practices in Qt Quick/QML - Part 1 of 4
Best Practices in Qt Quick/QML - Part 1 of 4ICS
 
In-Depth Model/View with QML
In-Depth Model/View with QMLIn-Depth Model/View with QML
In-Depth Model/View with QMLICS
 
Qt Internationalization
Qt InternationalizationQt Internationalization
Qt InternationalizationICS
 
Best Practices in Qt Quick/QML - Part 4
Best Practices in Qt Quick/QML - Part 4Best Practices in Qt Quick/QML - Part 4
Best Practices in Qt Quick/QML - Part 4ICS
 
The linux networking architecture
The linux networking architectureThe linux networking architecture
The linux networking architecturehugo lu
 
Introduction to the Qt State Machine Framework using Qt 6
Introduction to the Qt State Machine Framework using Qt 6Introduction to the Qt State Machine Framework using Qt 6
Introduction to the Qt State Machine Framework using Qt 6ICS
 
Faster packet processing in Linux: XDP
Faster packet processing in Linux: XDPFaster packet processing in Linux: XDP
Faster packet processing in Linux: XDPDaniel T. Lee
 
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015NAVER / MusicPlatform
 

Tendances (20)

Android kotlin coroutines
Android kotlin coroutinesAndroid kotlin coroutines
Android kotlin coroutines
 
Introduction to kotlin coroutines
Introduction to kotlin coroutinesIntroduction to kotlin coroutines
Introduction to kotlin coroutines
 
Qt for Beginners Part 3 - QML and Qt Quick
Qt for Beginners Part 3 - QML and Qt QuickQt for Beginners Part 3 - QML and Qt Quick
Qt for Beginners Part 3 - QML and Qt Quick
 
Using Multi-Touch and Gestures with Qt
Using Multi-Touch and Gestures with QtUsing Multi-Touch and Gestures with Qt
Using Multi-Touch and Gestures with Qt
 
State of the Art OpenGL and Qt
State of the Art OpenGL and QtState of the Art OpenGL and Qt
State of the Art OpenGL and Qt
 
Best Practices in Qt Quick/QML - Part 1 of 4
Best Practices in Qt Quick/QML - Part 1 of 4Best Practices in Qt Quick/QML - Part 1 of 4
Best Practices in Qt Quick/QML - Part 1 of 4
 
In-Depth Model/View with QML
In-Depth Model/View with QMLIn-Depth Model/View with QML
In-Depth Model/View with QML
 
Introduction to Qt
Introduction to QtIntroduction to Qt
Introduction to Qt
 
merged
mergedmerged
merged
 
Qemu JIT Code Generator and System Emulation
Qemu JIT Code Generator and System EmulationQemu JIT Code Generator and System Emulation
Qemu JIT Code Generator and System Emulation
 
Qt Internationalization
Qt InternationalizationQt Internationalization
Qt Internationalization
 
Interpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratchInterpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratch
 
Best Practices in Qt Quick/QML - Part 4
Best Practices in Qt Quick/QML - Part 4Best Practices in Qt Quick/QML - Part 4
Best Practices in Qt Quick/QML - Part 4
 
The linux networking architecture
The linux networking architectureThe linux networking architecture
The linux networking architecture
 
Introduction to the Qt State Machine Framework using Qt 6
Introduction to the Qt State Machine Framework using Qt 6Introduction to the Qt State Machine Framework using Qt 6
Introduction to the Qt State Machine Framework using Qt 6
 
Golang workshop
Golang workshopGolang workshop
Golang workshop
 
Virtual Machine Constructions for Dummies
Virtual Machine Constructions for DummiesVirtual Machine Constructions for Dummies
Virtual Machine Constructions for Dummies
 
GoLang Introduction
GoLang IntroductionGoLang Introduction
GoLang Introduction
 
Faster packet processing in Linux: XDP
Faster packet processing in Linux: XDPFaster packet processing in Linux: XDP
Faster packet processing in Linux: XDP
 
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
 

En vedette

Special Effects with Qt Graphics View
Special Effects with Qt Graphics ViewSpecial Effects with Qt Graphics View
Special Effects with Qt Graphics Viewaccount inactive
 
Qt and QML performance tips & tricks for Qt 4.7
Qt and QML performance tips & tricks for Qt 4.7Qt and QML performance tips & tricks for Qt 4.7
Qt and QML performance tips & tricks for Qt 4.7Pasi Kellokoski
 
Best Practices in Qt Quick/QML - Part III
Best Practices in Qt Quick/QML - Part IIIBest Practices in Qt Quick/QML - Part III
Best Practices in Qt Quick/QML - Part IIIICS
 
How to Make Your Qt App Look Native
How to Make Your Qt App Look NativeHow to Make Your Qt App Look Native
How to Make Your Qt App Look Nativeaccount inactive
 
[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project
[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project
[Webinar] 10 Keys to Ensuring Success for Your Next Qt ProjectICS
 
Best Practices in Qt Quick/QML - Part I
Best Practices in Qt Quick/QML - Part IBest Practices in Qt Quick/QML - Part I
Best Practices in Qt Quick/QML - Part IICS
 
Tdc2011 goiânia-web apps-30102011
Tdc2011 goiânia-web apps-30102011Tdc2011 goiânia-web apps-30102011
Tdc2011 goiânia-web apps-30102011Awdren Fontão
 
Was Software-Archive erzählen
Was Software-Archive erzählenWas Software-Archive erzählen
Was Software-Archive erzählenThomas Zimmermann
 
Airports can maximize capacity with minimal capital investment through effect...
Airports can maximize capacity with minimal capital investment through effect...Airports can maximize capacity with minimal capital investment through effect...
Airports can maximize capacity with minimal capital investment through effect...Ikusi Velatia
 
Qt Memory Management & Signal and Slots
Qt Memory Management & Signal and SlotsQt Memory Management & Signal and Slots
Qt Memory Management & Signal and SlotsJussi Pohjolainen
 
Qt in depth - presentation for Symbian expo 2009
Qt in depth - presentation for Symbian expo 2009Qt in depth - presentation for Symbian expo 2009
Qt in depth - presentation for Symbian expo 2009Nokia
 
Efficient Graphics with Qt
Efficient Graphics with QtEfficient Graphics with Qt
Efficient Graphics with QtAriya Hidayat
 
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization SoftwareCase Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Softwareaccount inactive
 
Qt for beginners part 2 widgets
Qt for beginners part 2   widgetsQt for beginners part 2   widgets
Qt for beginners part 2 widgetsICS
 
Hybrid Apps with Qt
Hybrid Apps with QtHybrid Apps with Qt
Hybrid Apps with QtYnon Perek
 
Qt for beginners part 5 ask the experts
Qt for beginners part 5   ask the expertsQt for beginners part 5   ask the experts
Qt for beginners part 5 ask the expertsICS
 
Qt for beginners part 4 doing more
Qt for beginners part 4   doing moreQt for beginners part 4   doing more
Qt for beginners part 4 doing moreICS
 
The Mobile Market and Qt
The Mobile Market and QtThe Mobile Market and Qt
The Mobile Market and QtEspen Riskedal
 

En vedette (20)

Special Effects with Qt Graphics View
Special Effects with Qt Graphics ViewSpecial Effects with Qt Graphics View
Special Effects with Qt Graphics View
 
Qt Widget In-Depth
Qt Widget In-DepthQt Widget In-Depth
Qt Widget In-Depth
 
Qt and QML performance tips & tricks for Qt 4.7
Qt and QML performance tips & tricks for Qt 4.7Qt and QML performance tips & tricks for Qt 4.7
Qt and QML performance tips & tricks for Qt 4.7
 
Best Practices in Qt Quick/QML - Part III
Best Practices in Qt Quick/QML - Part IIIBest Practices in Qt Quick/QML - Part III
Best Practices in Qt Quick/QML - Part III
 
How to Make Your Qt App Look Native
How to Make Your Qt App Look NativeHow to Make Your Qt App Look Native
How to Make Your Qt App Look Native
 
[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project
[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project
[Webinar] 10 Keys to Ensuring Success for Your Next Qt Project
 
Best Practices in Qt Quick/QML - Part I
Best Practices in Qt Quick/QML - Part IBest Practices in Qt Quick/QML - Part I
Best Practices in Qt Quick/QML - Part I
 
Tdc2011 goiânia-web apps-30102011
Tdc2011 goiânia-web apps-30102011Tdc2011 goiânia-web apps-30102011
Tdc2011 goiânia-web apps-30102011
 
Was Software-Archive erzählen
Was Software-Archive erzählenWas Software-Archive erzählen
Was Software-Archive erzählen
 
Airports can maximize capacity with minimal capital investment through effect...
Airports can maximize capacity with minimal capital investment through effect...Airports can maximize capacity with minimal capital investment through effect...
Airports can maximize capacity with minimal capital investment through effect...
 
Qt Memory Management & Signal and Slots
Qt Memory Management & Signal and SlotsQt Memory Management & Signal and Slots
Qt Memory Management & Signal and Slots
 
Resume Pavel Krizskiy
Resume Pavel KrizskiyResume Pavel Krizskiy
Resume Pavel Krizskiy
 
Qt in depth - presentation for Symbian expo 2009
Qt in depth - presentation for Symbian expo 2009Qt in depth - presentation for Symbian expo 2009
Qt in depth - presentation for Symbian expo 2009
 
Efficient Graphics with Qt
Efficient Graphics with QtEfficient Graphics with Qt
Efficient Graphics with Qt
 
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization SoftwareCase Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
Case Study: Using Qt to Develop Advanced GUIs & Advanced Visualization Software
 
Qt for beginners part 2 widgets
Qt for beginners part 2   widgetsQt for beginners part 2   widgets
Qt for beginners part 2 widgets
 
Hybrid Apps with Qt
Hybrid Apps with QtHybrid Apps with Qt
Hybrid Apps with Qt
 
Qt for beginners part 5 ask the experts
Qt for beginners part 5   ask the expertsQt for beginners part 5   ask the experts
Qt for beginners part 5 ask the experts
 
Qt for beginners part 4 doing more
Qt for beginners part 4   doing moreQt for beginners part 4   doing more
Qt for beginners part 4 doing more
 
The Mobile Market and Qt
The Mobile Market and QtThe Mobile Market and Qt
The Mobile Market and Qt
 

Similaire à Optimizing Performance in Qt-Based Applications

Smashing the bottleneck: Qt application profiling
Smashing the bottleneck: Qt application profilingSmashing the bottleneck: Qt application profiling
Smashing the bottleneck: Qt application profilingDeveler S.r.l.
 
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese..."Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...Edge AI and Vision Alliance
 
Intro to Kubernetes & GitOps Workshop
Intro to Kubernetes & GitOps WorkshopIntro to Kubernetes & GitOps Workshop
Intro to Kubernetes & GitOps WorkshopWeaveworks
 
下午3 intel fenghaitao_mee_go api and application development
下午3 intel fenghaitao_mee_go api and application development下午3 intel fenghaitao_mee_go api and application development
下午3 intel fenghaitao_mee_go api and application developmentcsdnmobile
 
Advanced Visualization with OpenGL in Oil & Gas
Advanced Visualization with OpenGL in Oil & GasAdvanced Visualization with OpenGL in Oil & Gas
Advanced Visualization with OpenGL in Oil & Gasaccount inactive
 
Eclipse Day India 2015 - Java bytecode analysis and JIT
Eclipse Day India 2015 - Java bytecode analysis and JITEclipse Day India 2015 - Java bytecode analysis and JIT
Eclipse Day India 2015 - Java bytecode analysis and JITEclipse Day India
 
Free GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOpsFree GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOpsWeaveworks
 
The Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance TuningThe Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance TuningjClarity
 
Debugging Numerical Simulations on Accelerated Architectures - TotalView fo...
 Debugging Numerical Simulations on Accelerated Architectures  - TotalView fo... Debugging Numerical Simulations on Accelerated Architectures  - TotalView fo...
Debugging Numerical Simulations on Accelerated Architectures - TotalView fo...Rogue Wave Software
 
GC Tuning Confessions Of A Performance Engineer
GC Tuning Confessions Of A Performance EngineerGC Tuning Confessions Of A Performance Engineer
GC Tuning Confessions Of A Performance EngineerMonica Beckwith
 
Free GitOps Workshop
Free GitOps WorkshopFree GitOps Workshop
Free GitOps WorkshopWeaveworks
 
Clr jvm implementation differences
Clr jvm implementation differencesClr jvm implementation differences
Clr jvm implementation differencesJean-Philippe BEMPEL
 
Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations DVClub
 
Track A-2 基於 Spark 的數據分析
Track A-2 基於 Spark 的數據分析Track A-2 基於 Spark 的數據分析
Track A-2 基於 Spark 的數據分析Etu Solution
 
Sista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performanceSista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performanceESUG
 
Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13Daker Fernandes
 
Performance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedPerformance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedTim Callaghan
 

Similaire à Optimizing Performance in Qt-Based Applications (20)

Smashing the bottleneck: Qt application profiling
Smashing the bottleneck: Qt application profilingSmashing the bottleneck: Qt application profiling
Smashing the bottleneck: Qt application profiling
 
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese..."Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
 
Intro to Kubernetes & GitOps Workshop
Intro to Kubernetes & GitOps WorkshopIntro to Kubernetes & GitOps Workshop
Intro to Kubernetes & GitOps Workshop
 
下午3 intel fenghaitao_mee_go api and application development
下午3 intel fenghaitao_mee_go api and application development下午3 intel fenghaitao_mee_go api and application development
下午3 intel fenghaitao_mee_go api and application development
 
Advanced Visualization with OpenGL in Oil & Gas
Advanced Visualization with OpenGL in Oil & GasAdvanced Visualization with OpenGL in Oil & Gas
Advanced Visualization with OpenGL in Oil & Gas
 
Eclipse Day India 2015 - Java bytecode analysis and JIT
Eclipse Day India 2015 - Java bytecode analysis and JITEclipse Day India 2015 - Java bytecode analysis and JIT
Eclipse Day India 2015 - Java bytecode analysis and JIT
 
Free GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOpsFree GitOps Workshop + Intro to Kubernetes & GitOps
Free GitOps Workshop + Intro to Kubernetes & GitOps
 
The Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance TuningThe Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance Tuning
 
QtQuick Day 1
QtQuick Day 1QtQuick Day 1
QtQuick Day 1
 
Debugging Numerical Simulations on Accelerated Architectures - TotalView fo...
 Debugging Numerical Simulations on Accelerated Architectures  - TotalView fo... Debugging Numerical Simulations on Accelerated Architectures  - TotalView fo...
Debugging Numerical Simulations on Accelerated Architectures - TotalView fo...
 
GC Tuning Confessions Of A Performance Engineer
GC Tuning Confessions Of A Performance EngineerGC Tuning Confessions Of A Performance Engineer
GC Tuning Confessions Of A Performance Engineer
 
Værktøjer udviklet på AAU til analyse af SCJ programmer
Værktøjer udviklet på AAU til analyse af SCJ programmerVærktøjer udviklet på AAU til analyse af SCJ programmer
Værktøjer udviklet på AAU til analyse af SCJ programmer
 
Free GitOps Workshop
Free GitOps WorkshopFree GitOps Workshop
Free GitOps Workshop
 
Clr jvm implementation differences
Clr jvm implementation differencesClr jvm implementation differences
Clr jvm implementation differences
 
Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations
 
Track A-2 基於 Spark 的數據分析
Track A-2 基於 Spark 的數據分析Track A-2 基於 Spark 的數據分析
Track A-2 基於 Spark 的數據分析
 
Sista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performanceSista: Improving Cog’s JIT performance
Sista: Improving Cog’s JIT performance
 
Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13Plasmaquick Workshop - FISL 13
Plasmaquick Workshop - FISL 13
 
CFD on Power
CFD on Power CFD on Power
CFD on Power
 
Performance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons LearnedPerformance Benchmarking: Tips, Tricks, and Lessons Learned
Performance Benchmarking: Tips, Tricks, and Lessons Learned
 

Plus de account inactive

KDE Plasma for Mobile Phones
KDE Plasma for Mobile PhonesKDE Plasma for Mobile Phones
KDE Plasma for Mobile Phonesaccount inactive
 
Shipping Mobile Applications Using Qt for Symbian
Shipping Mobile Applications Using Qt for SymbianShipping Mobile Applications Using Qt for Symbian
Shipping Mobile Applications Using Qt for Symbianaccount inactive
 
Scripting Your Qt Application
Scripting Your Qt ApplicationScripting Your Qt Application
Scripting Your Qt Applicationaccount inactive
 
Developments in The Qt WebKit Integration
Developments in The Qt WebKit IntegrationDevelopments in The Qt WebKit Integration
Developments in The Qt WebKit Integrationaccount inactive
 
Qt on Real Time Operating Systems
Qt on Real Time Operating SystemsQt on Real Time Operating Systems
Qt on Real Time Operating Systemsaccount inactive
 
Development with Qt for Windows CE
Development with Qt for Windows CEDevelopment with Qt for Windows CE
Development with Qt for Windows CEaccount inactive
 
Translating Qt Applications
Translating Qt ApplicationsTranslating Qt Applications
Translating Qt Applicationsaccount inactive
 
Qt State Machine Framework
Qt State Machine FrameworkQt State Machine Framework
Qt State Machine Frameworkaccount inactive
 
Mobile Development with Qt for Symbian
Mobile Development with Qt for SymbianMobile Development with Qt for Symbian
Mobile Development with Qt for Symbianaccount inactive
 
Animation Framework: A Step Towards Modern UIs
Animation Framework: A Step Towards Modern UIsAnimation Framework: A Step Towards Modern UIs
Animation Framework: A Step Towards Modern UIsaccount inactive
 
Debugging Qt, Fixing and Contributing a Bug Report (Using Gitorious)
Debugging Qt, Fixing and Contributing a Bug Report (Using Gitorious)Debugging Qt, Fixing and Contributing a Bug Report (Using Gitorious)
Debugging Qt, Fixing and Contributing a Bug Report (Using Gitorious)account inactive
 
Copy Your Favourite Nokia App with Qt
Copy Your Favourite Nokia App with QtCopy Your Favourite Nokia App with Qt
Copy Your Favourite Nokia App with Qtaccount inactive
 
The Next Generation Qt Item Views
The Next Generation Qt Item ViewsThe Next Generation Qt Item Views
The Next Generation Qt Item Viewsaccount inactive
 
Case Study: Porting Qt for Embedded Linux on Embedded Processors
Case Study: Porting Qt for Embedded Linux on Embedded ProcessorsCase Study: Porting Qt for Embedded Linux on Embedded Processors
Case Study: Porting Qt for Embedded Linux on Embedded Processorsaccount inactive
 

Plus de account inactive (20)

Meet Qt
Meet QtMeet Qt
Meet Qt
 
KDE Plasma for Mobile Phones
KDE Plasma for Mobile PhonesKDE Plasma for Mobile Phones
KDE Plasma for Mobile Phones
 
Shipping Mobile Applications Using Qt for Symbian
Shipping Mobile Applications Using Qt for SymbianShipping Mobile Applications Using Qt for Symbian
Shipping Mobile Applications Using Qt for Symbian
 
The Future of Qt Widgets
The Future of Qt WidgetsThe Future of Qt Widgets
The Future of Qt Widgets
 
Scripting Your Qt Application
Scripting Your Qt ApplicationScripting Your Qt Application
Scripting Your Qt Application
 
Developments in The Qt WebKit Integration
Developments in The Qt WebKit IntegrationDevelopments in The Qt WebKit Integration
Developments in The Qt WebKit Integration
 
Qt Kwan-Do
Qt Kwan-DoQt Kwan-Do
Qt Kwan-Do
 
Qt on Real Time Operating Systems
Qt on Real Time Operating SystemsQt on Real Time Operating Systems
Qt on Real Time Operating Systems
 
Development with Qt for Windows CE
Development with Qt for Windows CEDevelopment with Qt for Windows CE
Development with Qt for Windows CE
 
Translating Qt Applications
Translating Qt ApplicationsTranslating Qt Applications
Translating Qt Applications
 
Qt Creator Bootcamp
Qt Creator BootcampQt Creator Bootcamp
Qt Creator Bootcamp
 
Qt State Machine Framework
Qt State Machine FrameworkQt State Machine Framework
Qt State Machine Framework
 
Mobile Development with Qt for Symbian
Mobile Development with Qt for SymbianMobile Development with Qt for Symbian
Mobile Development with Qt for Symbian
 
Animation Framework: A Step Towards Modern UIs
Animation Framework: A Step Towards Modern UIsAnimation Framework: A Step Towards Modern UIs
Animation Framework: A Step Towards Modern UIs
 
Debugging Qt, Fixing and Contributing a Bug Report (Using Gitorious)
Debugging Qt, Fixing and Contributing a Bug Report (Using Gitorious)Debugging Qt, Fixing and Contributing a Bug Report (Using Gitorious)
Debugging Qt, Fixing and Contributing a Bug Report (Using Gitorious)
 
The Mobility Project
The Mobility ProjectThe Mobility Project
The Mobility Project
 
Copy Your Favourite Nokia App with Qt
Copy Your Favourite Nokia App with QtCopy Your Favourite Nokia App with Qt
Copy Your Favourite Nokia App with Qt
 
The Next Generation Qt Item Views
The Next Generation Qt Item ViewsThe Next Generation Qt Item Views
The Next Generation Qt Item Views
 
Qt Licensing Explained
Qt Licensing ExplainedQt Licensing Explained
Qt Licensing Explained
 
Case Study: Porting Qt for Embedded Linux on Embedded Processors
Case Study: Porting Qt for Embedded Linux on Embedded ProcessorsCase Study: Porting Qt for Embedded Linux on Embedded Processors
Case Study: Porting Qt for Embedded Linux on Embedded Processors
 

Dernier

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 

Dernier (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 

Optimizing Performance in Qt-Based Applications

  • 1. Optimizing Performance in Qt Applications 11/16/09
  • 2. Introduction • Bjørn Erik Nilsen – Software Engineer / Qt Widget Team – The architect behind Alien Widgets – Rewrote the Backing Store for Qt 4.5 – One of the guys implementing WidgetsOnGraphicsView – Author of QMdiArea/QMdiSubWindow – Author of QGraphicsEffect/QGraphicsEffectSource 2
  • 3. Agenda • Why Performance Matters • Performance Improvements in Qt 4.6 • How You Can Improve Performance 3
  • 4. Why Performance Matters • Attractive to users • Looks more professional • Help you get things done more efficiently • Keeps the flow 4
  • 5. Why Performance Matters • An example explains more than a thousand words 5
  • 6. Why Performance Matters • Performance is more important than ever before – Dynamic user interfaces • Qt Everywhere – Desktop – Embedded platforms with limited hardware • We cannot just buy better hardware anymore • Clock speed vs. number of cores 6
  • 7. Why Performance Matters • Not all applications can take advantage of multiple cores • And some will actually run slower: – Each core in the processor is slower – Most applications not programmed to be multi- threaded • Multi-core crisis? 7
  • 8. Agenda • Why Performance Matters • Performance Improvements in Qt 4.6 • How You Can Improve Performance 8
  • 9. Performance Improvements in Qt 4.6 • We continuously strive to optimize the performance – QWidget painting performance, for example: – Qt 4.6 no exception! 9
  • 10. Performance Improvements in Qt 4.6 QtOpenGL QtGui QtOpenVG QtSvg QtScript QtCore QtWebKit QtNetwork 10
  • 11. Performance Improvements in Qt 4.6 • Graphics View – New update mechanism QtGui – New painting algorithm – New scene indexing – Reduced QTransform/QVariant/floating point overhead • QPixmapCache – Extended with an int based API 11
  • 12. Performance Improvements in Qt 4.6 • Item Views – Item selection QtGui – Drag 'n' drop – QTableView and QHeaderView • QTransform – fromTranslate/fromScale – mapRect for projective transforms • QRegion – No longer a GDI object on Windows 12
  • 13. Performance Improvements in Qt 4.6 • QObject – Destruction QtCore – Connect and disconnect – Signal emission • QVariant – Construction from float and pointers • QIODevice – Less (re)allocations in readAll() 13
  • 14. Performance Improvements in Qt 4.6 • QNetworkAccessManager – HTTP back-end QtNetwork • QHttpNetworkConnectionChannel – Pipelining HTTP requests (off by default) • QHttpNetworkConnection – Increased the number of concurrent connections • QLocalSocket – New Windows implementation – Major performance improvements 14
  • 15. Performance Improvements in Qt 4.6 QtScript • QtScript now uses JavaScriptCore as the back-end! – Still the same API, but with JSC performance 15
  • 16. Performance Improvements in Qt 4.6 • New OpenGL 2.x paint engine • General improvements QtOpenGL – Clipping – Text drawing 16
  • 17. Performance Improvements in Qt 4.6 • New OpenVG paint engine New module! – Uses Khronos EGL API QtOpenVG – Configure Qt with “-openvg” • Support for hardware-accelerated 2D vector graphics on: – Embedded, mobile and consumer electronic devices – Desktop • More info: http://labs.trolltech.com/blogs 17
  • 18. Performance Improvements in Qt 4.6 Embedded • Improved support for DirectFB – Enabling hardware graphics acceleration on embedded platforms • Maemo Harmattan optimizations 18
  • 19. Agenda • Why Performance Matters • Performance Improvements in Qt 4.6 • How You Can Improve Performance 19
  • 20. How You Can Improve Performance • Theory of Constraints (TOC) by Eliyahu M. Goldratt • The theory is based on the idea that in any complex system, there is usually one aspect of that system that limits its ability to achieve its goal or optimal functioning. To achieve any significant improvement of the system, the constraint must be identified and resolved. • Applications will perform as fast as their bottlenecks 20
  • 21. Theory of Constraints • Define a goal: – For example: This application must run at 30 FPS • Then: 1) Identify the constraint 2) Decide how to exploit the constraint 3) Improve 4) If goal not reached, go back to 1) 5) Done 21
  • 22. Identifying hot spots (1) • The number one and most important task • Make sure you have plausible data • Don't randomly start looking for slow code paths! – An O(n2) algorithm isn't necessarily bad – Don't spend time on making it O(n log n) just for fun • Don't spend time on optimizing bubble sort 22
  • 23. Identifying hot spots (1) • “Bottlenecks occur in surprising places, so don't try second guess and put in a speed hack until you have proven that is where the bottleneck is” -- Rob Pike 23
  • 24. Identifying hot spots (1) • The right approach for identifying hot spots: – Any profiler suitable for your platform • Shark (Mac OSX) • Valgrind (X11) • Visual Studio Profiler (Windows) • Embedded Trace Macrocell (ETM) (ARM devices) • NB! Always profile in release mode 24
  • 25. Identifying hot spots (1) • Run application: “valgrind --tool=callgrind ./application” • This will collect data and information about the program • Data saved to file: callgrind.out.<pid> • Beware: – I/O costs won't show up – Cache misses (--simulate-cache=yes) • The next step is to analyze the data/profile • Example 25
  • 26. Identifying hot spots (1) • Profiling a section of code (run with “–instr-atstart=no”): #include<BbrValgrind/callgrind.h> int myFunction() const { CALLGRIND_START_INSTRUMENTATION; int number = 10; ... CALLGRIND_STOP_INSTRUMENTATION; CALLGRIND_DUMP_STATS; return number; } 26
  • 27. Identifying hot spots (1) • When a hot-spot is identified: – Look at the code and ask yourself: Is this the right algorithm for this task? • Once the best algorithm is selected, you can exploit the constraint 27
  • 28. How to exploit the constraint (2) • Optimize – Design level – Source code level – Compile level • Optimization trade-offs: – Memory consumption, cache misses – Code clarity and conciseness 28
  • 29. How to exploit the constraint (2) • “Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius – and a lot of courage – to move in the opposite direction.” --Einstein 29
  • 30. How to exploit the constraint (2) • Wouldn't it be great to have a cross-platform tool to measure performance? 30
  • 31. QTestLib • Say hello to QBENCHMARK • Extension to the QTestLib framework • Cross-platform • Straight forward: QBENCHMARK { <code here> } • Code will then be measured based on – Walltime (default) – CPU tick counter (-tickcounter) – Valgrind/Callgrind (-callgrind) – Event counter (-eventcounter) 31
  • 32. QTestLib • Let's create a benchmark • Run with ./mytest -xml -o results.xml • git clone git://gitorious.org/qt-labs/qtestlib-tools.git • Visualize with – Graph (generatereport results.xml) – BMCompare (bmcompare results1.xml results2.xml) • Now that we have tool, it is easier to measure and decide which algorithm to use 32
  • 33. How to exploit the constraint (2) • General tricks: – Caching – Delay a computation until the result is required – Reduce computation in tight loops – Compiler optimizations • Optimization Techniques for Qt: – Choose the right container – Use implicit data sharing efficiently – Discover the magic flags 33
  • 34. Implicit data sharing in Qt • Maximize resource usage and minimize copying Object obj0; // Creates ObjectData // Copies (share the same data) Object obj1, obj2, obj3 = obj0; Object 1 Object 0 ObjectData Object 2 Object 3 Shallow copies 34
  • 35. Implicit data sharing in Qt • Data is only copied if someone modifies it: Deep copy ObjectData Object 1 Object 0 ObjectData Object 2 Object 3 Shallow copies 35
  • 36. Implicit data sharing in Qt • How to avoid deep-copy: – Only use const operators and functions if possible – Be careful with the foreach keyword • For classes that are not implicitly shared: – Always pass them around as const references – Passing const references is a good habit in any case • Examples 36
  • 37. Implicit data sharing in Qt Original Optimized T *readOnly = list[index]; T *readOnly = list.at(index); QList<T>::iterator i; QList<T>::const_iterator i; i = list.begin(); i = list.constBegin(); foreach (QString s, strings) foreach (const QString &s, strings) NB! QTransform is not implicitly shared! void foo(QTransform t); void foo(const QTransform &t); 37
  • 38. Implicit data sharing in Qt • See the “Implicitly Shared Classes” documentation for a complete list of implicitly shared classes in Qt • http://doc.trolltech.com/4.6-snapshot/shared.html • Note: All Qt containers are implicitly shared 38
  • 39. Qt Containers QLinkedList QList QVector QSet QStack QQueue QMultiHash QMap QHash QMultiMap 39
  • 40. Qt Containers QHash QMap QMultiHash QMultiMap Associative Containers 40
  • 41. Qt Containers QSet QList QVector QLinkedList QQueue QStack Sequential Containers 41
  • 42. Qt Containers vs QList QVector QLinkedList QQueue QStack Sequential Containers 42
  • 43. QVector<T> • Items are stored contiguously in memory • One block of memory is allocated: QBasicAtomicInt int int uint T T ref alloc size flags array[0] ... array[alloc - 1] QVectorTypedData<T> d QVector<T> 43
  • 44. QVector<T> • Reserves space at the end • Growth strategy depends on the type T – Movable types: realloc by increments of 4096 bytes – Non-movable types: 50% increments • What is a movable type? – Primitive types: bool, int, char, enums, pointers, … – Plain Old Data (POD) with no constructor/destructor – Basically everything that can be moved around in memory using memcpy() or memmove() – Good article: http://www.ddj.com/cpp/184401508 44
  • 45. Movable types • User-defined classes are treated as non-movable by default • Oh no! • Have no fear, Q_DECLARE_TYPEINFO is here • You can tell Qt that your class is a: – Q_PRIMITIVE_TYPE: POD with no constr./destr. – Q_MOVABLE_TYPE: has constr./destr., but can be moved in memory using memcpy()/memmove() 45
  • 46. Movable types (Q_PRIMITIVE_TYPE) struct Point2D { int x; int y; }; Q_DECLARE_TYPEINFO(Point2D, Q_PRIMITIVE_TYPE); 46
  • 47. Movable types (Q_MOVABLE_TYPE) class Point2D { public: Point2D() { data = new int[2]; } Point2D(const Point2D &other) { … } ~Point2D() { delete [] data; } Point2D &operator=(const Point2D &other) { … } int x() const { return data[0]; } int y() const { return data[1]; } private: int *data; }; Q_DECLARE_TYPEINFO(Point2D, Q_MOVABLE_TYPE); 47
  • 48. QVector<T> • Insertion in the middle: – Movable type: memmove() – Non-movable type: operator=() 1 0 1 2 3 4 5 6 0 1 2 3 4 5 6 7 48
  • 49. QList<T> • Two representations • Array of pointers to items on the heap (general case) QBasicAtomicInt int int int uint void * void * ref alloc begin end flags array[0] ... array[alloc - 1] QListData::Data T T d QList<T> 49
  • 50. QList<T> • Special case: T is movable and sizeof(T) <= sizeof(void *) • Items are stored directly (same as QVector) QBasicAtomicInt int int int uint T T ref alloc begin end flags array[0] ... array[alloc - 1] QListData::Data d QList<T> 50
  • 51. QList<T> • Reserves space at the beginning and at the end • Benefits of reserving space at the beginning – Prepending an item usually takes constant time – Removing the first item usually takes constant time – Faster insertion 51
  • 52. QVector<T> vs. QList<T> • QList expands to less code in the executable • For most purposes, QList is the right class to use • If all you do is append(), use QVector – Use reserve() if you know the size in advance – Also consider QVarLengthArray or plain C array • When T is movable and sizeof(T) <= sizeof(void *) – Almost no difference, except that QList provides faster insertions/removals in the first half of the list • (Constant time insertions in the middle: Use QLinkedList) 52
  • 53. General Qt Container Advices • Avoid deep copies, e.g: – Use at() rather than operator[] – constData()/constBegin()/constEnd() – Basically: limit usage of non-const functions • When you know the size in advance: – Use reserve() • Let Qt know whether your class is movable or not – Q_DECLARE_TYPEINFO • Choose the right container for the right circumstance 53
  • 54. General Painting Optimizations • Prefer QPixmap over QImage (if possible) – QPixmap is accelerated – QPixmap caches information about the pixels • Avoid QPixmap/QImage::setAlphaChannel() – Use QPainter::setCompositionMode instead • Avoid QPixmap/QImage::transformed() – Use QPainter::setWorldTransform instead • If you for sure know the image has alpha: – Qt::NoOpaqueDetection (QPixmap::fromImage) 54
  • 55. General Painting Optimizations Original int width = image.width(); int height = image.height(); for (int y = 0; y < height; ++y) { for (int x = 0; x < width; ++x) { QRgb pixel = image.pixel(x, y); … } } NB! Image is 32 bit 55
  • 56. General Painting Optimizations Optimized int width = image.width(); int height = image.height(); for (int y = 0; y < height; ++y) { QRgb *line = reinterpret_cast<QRgb *>(image.scanLine(y)); for (int x = 0; x < width; ++x) { QRgb pixel = line[x]; … } } 56
  • 57. General Painting Optimizations Even more optimized int numPixels = image.width() * image.height(); QRgb *pixels = reinterpret_cast<QRgb *>(image.bits()); for (int i = 0; i < numPixels; ++i) { QRgb pixel = pixels[i]; … } } 57
  • 58. General Painting Optimizations Original Optimized MyWidget::paintEvent(...) MyWidget::paintEvent(...) { { QPainter painter(this); QPainter painter(this); painter.fillRect(rect(), Qt::red); painter.fillRect(rect(), Qt::red); } } int main(int argc, char **argv) int main(int argc, char **argv) { { ... ... MyWidget widget; MyWidget widget; ... widget.setAttribute( } Qt::WA_OpaquePaintEvent); ... } 58
  • 59. General Painting Optimizations Original Optimized painter.drawLine(line1); QLine lines[3]; painter.drawLine(line2); ... painter.drawLine(line3); painter.drawLines(lines, 3); painter.drawPoint(point1); QPoint points[3]; painter.drawPoint(point2); ... painter.drawPoint(point3); painter.drawPoints(points, 3); QString key(“abcd”); QPixmapCache::Key key; QPixmapCache::insert(key, pm); key = QPixmapCache::insert(pm); QPixmapCache::find(key, pm); pm = QPixmapCache::find(key); 59
  • 60. Other Optimizations Original Optimized const QString s = s1 + s2 + s3; #include <QStringBuilder> ... #define QT_USE_FAST_CONCATENATION const QString s = s1 % s2 % s3; #define QT_USE_FAST_OPERATOR_PLUS QTransform xform = a.inverted(); QTransform xform = b; xform *= b.inverted(); xform *= a; xform = xform.inverted(); foreach (const QString &s, slist) { foreach (const QString &s, slist) { if (s.size() < 5) if (s.size() < 5) continue; continue; const QString m = s.mid(2, 3); QStringRef m(&s, 2, 3); if (m == magicString) if (m == magicString) doMagicStuff(); doMgicStuff(); } } 60
  • 61. Other Optimizations Original Optimized qFuzzyCompare(opacity+1, 1)); qFuzzyIsNull(opacity)); int nRects = qregion.rects().size(); int nRects = qregion.numRects(); if (expensive() && cheap()) if (cheap() && expensive()) #button1 { background:red } #button1, #button2 { background:red } #button2 { background:red } *[readOnly=”1”] { color:blue } /* Only QLineEdit can possibly be read-only in my application */ QLineEdit[readOnly = “1”] { color:blue } 61
  • 62. Graphics View Optimizations • Viewport update modes • Scene index – BSP tree index – No index • Avoid QGraphicsScene::changed signal • QGraphicsScene::setSceneRect • Cache modes – Device coordinates – Item coordinates • OpenGL viewport 62
  • 63. Platform Specific Optimizations • Link time optimization LTCG (Windows only) – Approx. 10%-15% speedup – Configure Qt with “-ltcg” • Don't use explicit double arithmetic – qreal is float on embedded (QWS) – 100 / 2.54 → 100 / qreal(2.54) • It's time time to take advantage of what we have learned • Let's do some real optimizations! 63
  • 64.
  • 65. Theory of Constraints • Define a goal: – For example: This application must run at 30 FPS • Then: 1) Identify the constraint 2) Decide how to exploit the constraint 3) Improve 4) If goal not reached, go back to 1) 5) Done 65
  • 66. Agenda • Why Performance Matters • Performance Improvements in Qt 4.6 • How You Can Improve Performance 66