Skip to content
Commit 3a42f5fc authored by Milian Wolff's avatar Milian Wolff
Browse files

Optimize ProjectBaseItem::takeRow

Inline more code and don't call rowCount repeatedly. In my
RelWithDebInfo build the compiler isn't smart enough to realize
the size doesn't change repeatedly and calls this function a lot.
We can optimize accordingly by hoisting out the size call. While
at it, I inline some other code too.

Before:
```
PASS   : BenchQuickOpen::benchProjectFileFilter_fileRemovedFromSet(1000)
RESULT : BenchQuickOpen::benchProjectFileFilter_fileRemovedFromSet():"1000":
     3 msecs per iteration (total: 3, iterations: 1)
PASS   : BenchQuickOpen::benchProjectFileFilter_fileRemovedFromSet(10000)
RESULT : BenchQuickOpen::benchProjectFileFilter_fileRemovedFromSet():"10000":
     281 msecs per iteration (total: 281, iterations: 1)
PASS   : BenchQuickOpen::cleanupTestCase()
```

After:
```
PASS   : BenchQuickOpen::benchProjectFileFilter_fileRemovedFromSet(1000)
RESULT : BenchQuickOpen::benchProjectFileFilter_fileRemovedFromSet():"1000":
     1 msecs per iteration (total: 1, iterations: 1)
PASS   : BenchQuickOpen::benchProjectFileFilter_fileRemovedFromSet(10000)
RESULT : BenchQuickOpen::benchProjectFileFilter_fileRemovedFromSet():"10000":
     192 msecs per iteration (total: 192, iterations: 1)
PASS   : BenchQuickOpen::cleanupTestCase()
```
parent fdb31263
Pipeline #556152 passed with stage
in 21 minutes and 21 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment