Bug 300285

Summary: gradient are really slow to calculate
Product: [Applications] krita Reporter: CyrilJedor <cyril.jedor>
Component: ToolsAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: halla
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Other   
Latest Commit: Version Fixed In:
Attachments: callgrind output

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

http://commits.kde.org/calligra/46e5b5534636024f7fb9fd9ddb40f740a78033ae
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

http://commits.kde.org/calligra/f967662e9b54ee865bb10eb9a1c02757da3c680e
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.