Bug 300285 - gradient are really slow to calculate
Summary: gradient are really slow to calculate
Alias: None
Product: krita
Classification: Applications
Component: Tools (show other bugs)
Version: unspecified
Platform: unspecified Other
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
Depends on:
Reported: 2012-05-18 23:40 UTC by CyrilJedor
Modified: 2012-06-04 09:59 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:

callgrind output (538.50 KB, application/gzip)
2012-05-26 07:11 UTC, Halla Rempt

Note You need to log in before you can comment on or make changes to this bug.
Description CyrilJedor 2012-05-18 23:40:31 UTC
Maybe it just me who is used to photoshop and the gradient are really quick. but i found the gradiant really slow to calculate. it took 4sec on an image size 1920x1080px This is not the worst bug but when you try to do multiple gradient it is a big waste of time.

Reproducible: Always
Comment 1 Halla Rempt 2012-05-26 07:11:12 UTC
Created attachment 71375 [details]
callgrind output

The attached callgrind output shows that we're spending way too much time in creating KoColor id's and comparing colorspace names. It should be quite possible to optimize this.
Comment 2 Halla Rempt 2012-05-26 07:25:02 UTC
Git commit 46e5b5534636024f7fb9fd9ddb40f740a78033ae by Boudewijn Rempt.
Committed on 26/05/2012 at 09:24.
Pushed by rempt into branch 'master'.

Make converting pixels much faster

The check for id() is really expensive (see valgrind log attached
to bug 300285), so short-circuit that in the common case where it's
not necessary.

M  +8    -2    libs/pigment/KoColorSpaceAbstract.h

Comment 3 Halla Rempt 2012-05-26 07:50:38 UTC
Git commit f967662e9b54ee865bb10eb9a1c02757da3c680e by Boudewijn Rempt.
Committed on 26/05/2012 at 09:49.
Pushed by rempt into branch 'master'.

KoID: Don't copy klocalized string

We use KoID as if it were an implicitly shared data class, and that
was mostly true as long as it only contained two QStrings. But copying
the KLocalizedString invalidates that assumption: copying that is
very expensive.

See the trace with bug 300285.

M  +13   -0    interfaces/KoID.h

Comment 4 Halla Rempt 2012-05-26 08:02:08 UTC
I think it's pretty ok now :-)
Comment 5 Halla Rempt 2012-06-04 09:59:45 UTC
I'll make a new windows build today.