New Tiled Data Manager ideas and tests

Bart Coppens kde at
Tue Jun 2 17:51:06 CEST 2009

On Tuesday 02 June 2009 17:25:58 Dmitry Kazakov wrote:
> New commit r976769
(For reference:

> A strange thing! I changed only one line and processors started working 20%
> faster than old system. I don't know why. Could someone take a look.
Well it is probably because you change the meaning of the variable. In the old 
version (const qint32 dataIdx), your variable is constant across the duration 
of the function. In the new version, (static const qint32 dataIdx) the 
variabe is constant for _all_ invocations of the function (after the first 

bartcopp at tuvok-debian:~/pruts$ cat
#include <iostream>
using namespace std;

int foo(int arg) { return arg + 1; }

int fun1(int arg) {
    static const int val = arg;
    return val;

int fun2(int arg) {
    const int val = arg;
    return val;

int main() {
    cout << fun1(1); cout << " " << fun1(2) << endl;
    cout << fun2(1); cout << " " << fun2(2) << endl;
bartcopp at tuvok-debian:~/pruts$ g++ -o constint && ./constint
1 1
1 2


More information about the kimageshop mailing list