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 585220 - performance of gtk+ with medialib support should be improved
performance of gtk+ with medialib support should be improved
Status: RESOLVED OBSOLETE
Product: gdk-pixbuf
Classification: Platform
Component: pixops
git master
Other opensolaris
: Normal normal
: ---
Assigned To: gdk-pixbuf-maint
gdk-pixbuf-maint
: 583767 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-06-09 08:01 UTC by Wang Xin
Modified: 2018-05-19 22:03 UTC
See Also:
GNOME target: ---
GNOME version: 2.27/2.28


Attachments
test result without medialib support (10.59 KB, text/plain)
2009-06-09 08:02 UTC, Wang Xin
  Details
test result with medialib support enabled (10.66 KB, text/plain)
2009-06-09 08:02 UTC, Wang Xin
  Details
patch to fix the problem (47.72 KB, patch)
2009-06-09 08:42 UTC, Wang Xin
none Details | Review
test result with new patch (10.68 KB, text/plain)
2009-06-09 08:43 UTC, Wang Xin
  Details
patch to fix the problem (19.74 KB, patch)
2009-06-09 08:46 UTC, Wang Xin
none Details | Review
test result with medialib support before applying my patch on sparc. (10.65 KB, text/plain)
2009-06-15 09:01 UTC, Wang Xin
  Details
test result with medialib support after applying my patch on sparc (10.67 KB, text/plain)
2009-06-15 09:04 UTC, Wang Xin
  Details
New patch (22.76 KB, patch)
2009-09-10 06:59 UTC, Wang Xin
needs-work Details | Review

Description Wang Xin 2009-06-09 08:01:09 UTC
I built 2 copy of gtk+ on Solaris, one with medialib support and another one without medialib support. I also modified timescale.c a little (change ITERS from 10 to 100000) to test the performance.

According to the test result, the performance of gtk+ with medialib support enabled is worse than gtk+ without medialib support in 2 cases:
1) if filter_level is PIXOPS_INTERP_NEAREST
2) if src_channels is 4 and dest_channels is 3 and src_channels has no alpha.
Comment 1 Wang Xin 2009-06-09 08:02:24 UTC
Created attachment 136187 [details]
test result without medialib support
Comment 2 Wang Xin 2009-06-09 08:02:58 UTC
Created attachment 136188 [details]
test result with medialib support enabled
Comment 3 Wang Xin 2009-06-09 08:42:33 UTC
Created attachment 136193 [details] [review]
patch to fix the problem

if filter_level is PIXOPS_INTERP_NEAREST, calls pixops_composite_nearest or  pixops_scale_nearest.

if src_channels is 4 and dest_channels is 3 and src_channels has no alpha,
, calls _pixops_scale_real.

Removes the following block, because (!src_has_alpha && overall_alpha == 255) has been handled before entering pixops_medialib_composite.
      if (!src_has_alpha && overall_alpha == 255 &&
         dest_channels <= src_channels) 
        {
          pixops_medialib_scale (dest_buf, dest_region_width,
                                dest_region_height, dest_rowstride,
                                dest_channels, dest_has_alpha, src_buf,
                                src_width, src_height, src_rowstride,
                                src_channels, src_has_alpha, dest_x, dest_y,
                                dest_region_width, dest_region_height,
                                offset_x, offset_y, scale_x, scale_y,
                                interp_type);
          return;
        }

Also removes the old code to handle the cases of "filter_level is PIXOPS_INTERP_NEAREST" or "src_channels is 4 and dest_channels is 3 and src_channels has no alpha".
Comment 4 Wang Xin 2009-06-09 08:43:30 UTC
Created attachment 136194 [details]
test result with new patch
Comment 5 Wang Xin 2009-06-09 08:46:38 UTC
Created attachment 136197 [details] [review]
patch to fix the problem

Sorry, I attached the wrong patch. This is the correct one.
Comment 6 Brian Cameron 2009-06-09 20:48:51 UTC
Wang, you don't specify whether your performance reports were using Solaris x86 or Solaris Sparc.  Could you specify?  Also, it would be good to also provide some performance report for both x86 and Sparc.  How does the performance compare between x86 and Sparc?
Comment 7 Brian Cameron 2009-06-09 22:19:37 UTC
Also, in pixops.c, in the function _pixops_use_medialib, there is this comment:

   * The first 2 digits of the version are the major version.  The 3rd digit
   * is the minor version, and the 4th digit is the micro version.  So the
   * above string corresponds to version 2.1.0.  In the following test we only
   * care about the major version.

Now, in the code we don't actually check the version number.  Now we just check the ISALIST identifier.  It would be good to fix this comment to remove the statement "In the following test we only care about the major version".  The file gdk/gdkmedialib.c has a similar comment which should also be fixed.  

If we are cleaning up the code, then it would be good to fix these comments.

Also, the configure script checks for mediaLib 2.3 and 2.5.  At this point, it is probably okay to remove mediaLib 2.3 support.  Would be nice to also clean up the code to just support mediaLib 2.5 only.


Comment 8 Wang Xin 2009-06-10 02:53:17 UTC
Brian, the result is for x86. I will paste the result for sparc later.
Comment 9 Wang Xin 2009-06-15 09:01:12 UTC
Created attachment 136611 [details]
test result with medialib support before applying my patch on sparc.
Comment 10 Wang Xin 2009-06-15 09:04:15 UTC
Created attachment 136612 [details]
test result with medialib support after applying my patch on sparc
Comment 11 Brian Cameron 2009-06-15 15:14:25 UTC
Thanks.  Based on these results, the code looks good to me.  Note that I was the author of the original mediaLib GTK+ integration code.

Note that my issues in comment #7 are really not related to this change.  If Wang provides an updated patch that resolves those issues, it would be nice, but should not hold up the integration of the patch.  The other issues could be treated as a separate bug.
Comment 12 Wang Xin 2009-09-10 03:32:50 UTC
Can someone take a look at this bug?
Comment 13 Brian Cameron 2009-09-10 03:36:00 UTC
In comment #7 I suggested a few more cleanups that should be made, but an updated patch was never provided.
Comment 14 Wang Xin 2009-09-10 04:47:58 UTC
I will update it soon.
Comment 15 Wang Xin 2009-09-10 06:59:54 UTC
Created attachment 142855 [details] [review]
New patch
Comment 16 Brian Cameron 2009-09-10 17:25:31 UTC
Thanks.  This patch looks good, and, in my opinion, is ready to go upstream.  I 
have verified that this does improve performance.
Comment 17 Matthias Clasen 2013-12-19 11:41:16 UTC
*** Bug 583767 has been marked as a duplicate of this bug. ***
Comment 18 Bastien Nocera 2016-12-19 16:48:35 UTC
Is this still useful?
Comment 19 Bastien Nocera 2016-12-19 16:50:20 UTC
Review of attachment 142855 [details] [review]:

The patch should be git-formatted, with a commit message.
Comment 20 Carlos Soriano 2018-05-19 22:03:11 UTC
Closing temporarily for migration, as it makes the migration tool fail.