After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 789807 - exposure: Avoid using unused channels
exposure: Avoid using unused channels
Status: RESOLVED FIXED
Product: GEGL
Classification: Other
Component: operations
git master
Other All
: Normal normal
: ---
Assigned To: Default Gegl Component Owner
Default Gegl Component Owner
Depends on:
Blocks:
 
 
Reported: 2017-11-02 08:11 UTC by Debarshi Ray
Modified: 2017-11-12 12:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
operations/common/exposure: Use alpha only if the source has it (11.05 KB, patch)
2017-11-02 08:13 UTC, Debarshi Ray
committed Details | Review
Test case (2.32 KB, text/plain)
2017-11-02 20:58 UTC, Debarshi Ray
  Details
operations/common/exposure: Add native support for monochrome buffers (7.01 KB, patch)
2017-11-02 21:02 UTC, Debarshi Ray
committed Details | Review
operations/common/exposure: Fix unpacking of floats into float3 (2.14 KB, patch)
2017-11-11 17:35 UTC, Debarshi Ray
none Details | Review
operations/common/exposure: Fix unpacking of floats into float3 (2.29 KB, patch)
2017-11-12 00:42 UTC, Debarshi Ray
none Details | Review
operations/common/exposure: Fix unpacking of floats into float3 (2.29 KB, patch)
2017-11-12 00:51 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2017-11-02 08:11:07 UTC
Same as bug 789704

While the speed-up is not as impressive as it was for gegl:grey, it is still measurable.

On an Intel i7 Haswell system, with 15 megapixel "R'G'B'A u8" and "R'G'B' u8" buffers as inputs and GEGL_THREADS=2, it goes from:
  CPU: 0.3 to 0.24
  GPU: 0.52 to 0.46

It can potentially add up to something more significant in bigger graphs with a series of optimized operations. The alpha channel amounts to 60 MB in this case, which is not a lot in terms of a process' address space, but still a lot in terms of useless memory access.
Comment 1 Debarshi Ray 2017-11-02 08:13:57 UTC
Created attachment 362796 [details] [review]
operations/common/exposure: Use alpha only if the source has it
Comment 2 Debarshi Ray 2017-11-02 20:55:30 UTC
It can be pushed a bit further by adding native support for monochrome buffers.

On an Intel i7 Haswell system, with 15 megapixel "R'G'B'A u8" and "R'G'B'
u8" buffers as inputs and GEGL_THREADS=2, the attached test case goes from:
  CPU: 0.38 to 0.08 (no alpha), 0.17 (alpha) 
  GPU: 0.62 to 0.36 (no alpha), 0.52 (alpha)
Comment 3 Debarshi Ray 2017-11-02 20:58:24 UTC
Created attachment 362853 [details]
Test case
Comment 4 Debarshi Ray 2017-11-02 21:02:35 UTC
Created attachment 362855 [details] [review]
operations/common/exposure: Add native support for monochrome buffers
Comment 5 Debarshi Ray 2017-11-11 17:35:33 UTC
Created attachment 363396 [details] [review]
operations/common/exposure: Fix unpacking of floats into float3

I might have made the same mistake that Massimo caught in https://bugzilla.gnome.org/show_bug.cgi?id=789554#c9

Completely untested. I don't understand OpenCL well enough and I might not have time to test it before the release.
Comment 6 Debarshi Ray 2017-11-12 00:42:59 UTC
Created attachment 363411 [details] [review]
operations/common/exposure: Fix unpacking of floats into float3

Tested. This should be fine.
Comment 7 Debarshi Ray 2017-11-12 00:51:09 UTC
Created attachment 363412 [details] [review]
operations/common/exposure: Fix unpacking of floats into float3

I just can't seem to get this right. I had deleted the actual arithmetic before creating the commit. :/
Comment 8 Øyvind Kolås (pippin) 2017-11-12 12:00:01 UTC
commit 813162c8768b2aca1490cabdcc2f59005a4d94ed
Author: Debarshi Ray <debarshir@gnome.org>
Date:   Sat Nov 11 18:30:04 2017 +0100

    operations/common/exposure: Fix unpacking of floats into float3
    
    Fallout from 55cf906717510a56a65daff01919fc11a255ad45
    
    https://bugzilla.gnome.org/show_bug.cgi?id=789807