Slow isDone()
Boudewijn Rempt
boud at valdyas.org
Tue Jul 5 20:54:46 CEST 2005
I've got the bumpmap filter working, and now I'm optimizing it. One point
where the filter took a lot of time was calling isDone() on the iterator,
compared to using a counter:
isDone():
krita (filters): Filter activated: Bumpmap
krita: Mapping took: 35
krita: Mapping took: 1939
krita (filters): Filter activated: Bumpmap
krita: Mapping took: 38
krita: Mapping took: 2047
krita (filters): Filter activated: Bumpmap
krita: Mapping took: 40
krita: Mapping took: 1900
counter:
krita (filters): Filter activated: Bumpmap
krita: Mapping took: 32
krita: Mapping took: 1134
krita (filters): Filter activated: Bumpmap
krita: Mapping took: 35
krita: Mapping took: 1744
krita (filters): Filter activated: Bumpmap
krita: Mapping took: 32
krita: Mapping took: 1194
krita (filters): Filter activated: Bumpmap
krita: Mapping took: 34
krita: Mapping took: 1761
The small number is for the preview: the larger number for a 1000x1000 image.
There's some variation, of course, because I just use QTime.elapsed, but the
pattern is clear: isDone() is always slower.
isDone() is not just a function call; except in the rect iterator it's
actually a computation.
In the light if this I wonder whether we shouldn't stop using isDone(). After
all, paint devices have no bounds, reads and writes are always valid, and we
know the extent to which we want to read beforehand because we give it as a
parameter to the create functions.
--
Boudewijn Rempt
http://www.valdyas.org/fading/index.cgi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20050705/e615468a/attachment.pgp
More information about the kimageshop
mailing list