]> icculus.org git repositories - dana/openbox.git/commit
use memcpy's to make splitvertical gradient much faster - using log n memcpy's is...
authorDana Jansens <danakj@orodu.net>
Sun, 10 Feb 2008 21:49:16 +0000 (16:49 -0500)
committerMikael Magnusson <mikachu@comhem.se>
Thu, 14 Feb 2008 18:40:02 +0000 (19:40 +0100)
commit1d00d9947067da76ac4d8d0a6b9ef2c28e73349e
treeaedd5d32e7b1a63ffed131181e110924ef53c7ec
parent18a35e04914bf8d108cf7a9d46970f13620ef534
use memcpy's to make splitvertical gradient much faster - using log n memcpy's is much quicker than setting a pointer value n times

Here are some profiling results.  splitvertical1 is the original code, splitvertical2 is some slight improvements in locality for it, and splitvertical3 is the new O(log n) memcpy code

  %   cumulative   self              self     total
 time   seconds   seconds    calls  ms/call  ms/call  name
 49.44      0.88     0.88     1063     0.83     0.83  gradient_splitvertical1
 47.19      1.72     0.84     1063     0.79     0.79  gradient_splitvertical2
  2.81      1.77     0.05     1063     0.05     0.05  gradient_splitvertical3

i also tested this with 'time' to draw 1000 gradients, and the new code used approximately half the user time, and finished 10 seconds quicker.  so yeah, it's magical and works well.
render/gradient.c