== Profiling of QtWebKit == === Basic Principles === Performance has many different aspects. This can include the binary size, memory usage, CPU usage, execution speed and in most cases when optimizing for one property another one will be impacted. E.g. for optimizing for execution speed another data structure with a bigger storage space is used. It is important to not only look at one property when doing a change and this is why we are focusing on the following items: Execution speed:: * How long does it take to load a page, how long does it take to scroll, how long does it take to paint, how big is the latency is to start a network job, how long does it take to decode a image? * In Qt the time can be measured using the `QBENCHMAKR { CODE }` macro in QtTest test cases. CPU usage:: * Who is using the CPU, how often is it used? * There are many different tools on many different architectures. On Linux x86 there is callgrind for other architectures supported by Linux there is [http://oprofile.sf.net OProfile]. The biggest difference between OProfile and callgrind is that OProfile is working by collecting samples and that callgrind is executing on a virtual machine. Memory usage:: * How much memory is consumed? How does this change over time? * There are multiple levels to track this. One way is to monitor how many pages the kernel has allocated for the process, another one is to look at the requested address space (sbrk) and the third way is to look at calls to malloc/free. The [http://www.secretlabs.de/memprof memprof] and memusage utilities do keep track of malloc/free calls. === Selecting target hardware === To generate a performance baseline hardware and base system needs to be selected. I have picked an ARM system for the profiling and the beagleboard in specific. The ARM architecture was picked as it is frequently used for mobile devices and future netbooks and that is the target for QtWebKit. The beagleboard was selected as it provides full access to the hardware (serial, JTAG), the tools are freely available (gcc, gdb, [http://openocd.berlios.de OpenOCD]), the Linux OMAP community has created good support for the SoC and is following mainline (in contrast to a horrible vendor port), the Cortex-A8 will be used in many future devices and the price of the beagleboard is quite low. One problem with the Cortex-A8 is that it might be too fast compared to previous ARM cores (e.g. VFP-3 fpu, Neon co-processor, bigger cache size, higher clock) but the above opportunities have outweightes this. === Tool selection ===