Closed
Bug 1276127
Opened 9 years ago
Closed 9 years ago
Enable SSE optimization in the in-tree libpng
Categories
(Core :: Graphics: ImageLib, enhancement)
Tracking
()
RESOLVED
FIXED
mozilla51
People
(Reporter: glennrp+bmo, Assigned: glennrp+bmo)
References
Details
Attachments
(2 files, 15 obsolete files)
|
14.12 KB,
patch
|
jrmuizel
:
review+
|
Details | Diff | Splinter Review |
|
8.67 KB,
patch
|
jrmuizel
:
review+
|
Details | Diff | Splinter Review |
Libpng-1.6.22 offers optimized support for Intel-SSE platforms. It's not enabled by default.
| Assignee | ||
Updated•9 years ago
|
| Assignee | ||
Comment 1•9 years ago
|
||
In bug # 1275901 (update embedded libpng to version 1.6.23) comment #14 Seth commented:
I did want to bring to your attention that for now, at least, we are still supporting machines that have SSE but not SSE2. I just wanted to make sure you've thought about this, as we've seen some nasty issues related to running SSE2 code on SSE-only machines in the past.
| Assignee | ||
Comment 2•9 years ago
|
||
| Assignee | ||
Comment 3•9 years ago
|
||
| Assignee | ||
Comment 4•9 years ago
|
||
| Assignee | ||
Comment 6•9 years ago
|
||
Seth wrote in comment #1
> I did want to bring to your attention that for now, at least, we are still
> supporting machines that have SSE but not SSE2. I just wanted to make sure
> you've thought about this, as we've seen some nasty issues related to
> running SSE2 code on SSE-only machines in the past.
There is code in pngpriv.h that tries to sort out the various levels of SSE support.
Comment 7•9 years ago
|
||
applying v00-1276127-part01-add-sse-directory-to-intree-libpng.diff
unable to find 'media/libpng/sse2/intel_init.c' for patching
Flags: needinfo?(ryanvm)
| Assignee | ||
Comment 8•9 years ago
|
||
diff against /dev/null instead of existing media/libpng/sse2 directory
Please retry all parts together
Attachment #8775784 -
Attachment is obsolete: true
Flags: needinfo?(ryanvm)
| Assignee | ||
Comment 9•9 years ago
|
||
| Assignee | ||
Comment 10•9 years ago
|
||
Simplified SSE and ARM selection in old-configure.in
Attachment #8775787 -
Attachment is obsolete: true
| Assignee | ||
Comment 11•9 years ago
|
||
Further simplify SSE/ARM selection in old-configure.in
Attachment #8776415 -
Attachment is obsolete: true
| Assignee | ||
Comment 12•9 years ago
|
||
| Assignee | ||
Comment 13•9 years ago
|
||
Conditionally compile sse2 headers
Attachment #8775785 -
Attachment is obsolete: true
Comment 14•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=efa537a529fb
Sorry for the extra commits in that patch queue. They're not going to hurt anything.
Flags: needinfo?(ryanvm)
Comment 15•9 years ago
|
||
Comment on attachment 8776423 [details] [diff] [review]
v00-1276127-part06-sse-changes
The commit message calls this part 5
Attachment #8776423 -
Flags: feedback-
| Assignee | ||
Comment 16•9 years ago
|
||
Fixed typo in part06 checkin message
| Assignee | ||
Updated•9 years ago
|
Attachment #8776423 -
Flags: feedback-
| Assignee | ||
Updated•9 years ago
|
Attachment #8776423 -
Attachment is obsolete: true
| Assignee | ||
Comment 17•9 years ago
|
||
Comment on attachment 8775998 [details] [diff] [review]
v01-1276127-part01-add-sse-directory-to-intree-libpng
Try is all green and logs show SSE2 support was built.
Attachment #8775998 -
Flags: review?(tnikkel)
| Assignee | ||
Updated•9 years ago
|
Attachment #8776439 -
Flags: review?(tnikkel)
| Assignee | ||
Updated•9 years ago
|
Attachment #8775786 -
Flags: review?(tnikkel)
| Assignee | ||
Updated•9 years ago
|
Attachment #8776422 -
Flags: review?(tnikkel)
| Assignee | ||
Updated•9 years ago
|
Attachment #8776218 -
Flags: review?(tnikkel)
| Assignee | ||
Updated•9 years ago
|
Attachment #8776721 -
Flags: review?(tnikkel)
Comment 18•9 years ago
|
||
Comment on attachment 8775786 [details] [diff] [review]
v00-1276127-part03-sse-mozbuild
Redirecting to Jeff.
Attachment #8775786 -
Flags: review?(tnikkel) → review?(jmuizelaar)
Updated•9 years ago
|
Attachment #8775998 -
Flags: review?(tnikkel) → review?(jmuizelaar)
Updated•9 years ago
|
Attachment #8776218 -
Flags: review?(tnikkel) → review?(jmuizelaar)
Updated•9 years ago
|
Attachment #8776422 -
Flags: review?(tnikkel) → review?(jmuizelaar)
Updated•9 years ago
|
Attachment #8776439 -
Flags: review?(tnikkel) → review?(jmuizelaar)
Updated•9 years ago
|
Attachment #8776721 -
Flags: review?(tnikkel) → review?(jmuizelaar)
| Assignee | ||
Comment 19•9 years ago
|
||
Rebased.
Attachment #8776422 -
Attachment is obsolete: true
Attachment #8776422 -
Flags: review?(jmuizelaar)
| Assignee | ||
Comment 20•9 years ago
|
||
Split from part04
| Assignee | ||
Updated•9 years ago
|
Attachment #8777869 -
Flags: review?(jmuizelaar)
| Assignee | ||
Updated•9 years ago
|
Attachment #8777870 -
Flags: review?(jmuizelaar)
Comment 21•9 years ago
|
||
Comment on attachment 8775786 [details] [diff] [review]
v00-1276127-part03-sse-mozbuild
Review of attachment 8775786 [details] [diff] [review]:
-----------------------------------------------------------------
::: media/libpng/moz.build
@@ +37,5 @@
> SOURCES += [
> 'arm/filter_neon.S'
> ]
>
> +if CONFIG['MOZ_PNG_INTEL_SSE']:
I think this can be:
if CONFIG['INTEL_ARCHITECTURE']:
I wasn't able to find out what's supposed to set MOZ_PNG_INTEL_SSE
Attachment #8775786 -
Flags: review?(jmuizelaar) → review-
| Assignee | ||
Comment 22•9 years ago
|
||
(In reply to Jeff Muizelaar [:jrmuizel] from comment #21)
> Comment on attachment 8775786 [details] [diff] [review]
> v00-1276127-part03-sse-mozbuild
>
> Review of attachment 8775786 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: media/libpng/moz.build
> @@ +37,5 @@
> > SOURCES += [
> > 'arm/filter_neon.S'
> > ]
> >
> > +if CONFIG['MOZ_PNG_INTEL_SSE']:
>
> I think this can be:
> if CONFIG['INTEL_ARCHITECTURE']:
>
> I wasn't able to find out what's supposed to set MOZ_PNG_INTEL_SSE
It's set in old-configure.in (patch part 04) and can be disabled
with --enable-png-intel-sse-support=(yes/no)
| Assignee | ||
Comment 23•9 years ago
|
||
Move --enable-png-sse-support (and --enable-png-arm-neon-support) test outside the "case CPU_ARCH" test so user can override the result. So:
PNG_INTEL_SSE_SUPPORT is 0 by default, then 1 on x86 or x86-64, and finally 0 or 1 if --enable/--disable is present.
Attachment #8777869 -
Attachment is obsolete: true
Attachment #8777869 -
Flags: review?(jmuizelaar)
Comment 24•9 years ago
|
||
(In reply to Glenn Randers-Pehrson from comment #23)
> Created attachment 8778023 [details] [diff] [review]
> v03-1276127-part04-sse-old.configure
>
> Move --enable-png-sse-support (and --enable-png-arm-neon-support) test
> outside the "case CPU_ARCH" test so user can override the result. So:
> PNG_INTEL_SSE_SUPPORT is 0 by default, then 1 on x86 or x86-64, and finally
> 0 or 1 if --enable/--disable is present.
Is there any reason we would want to disable SSE support?
Flags: needinfo?(glennrp+bmo)
| Assignee | ||
Comment 25•9 years ago
|
||
We might want to allow users to disable SSE support for debugging or performance testing purposes.
Flags: needinfo?(glennrp+bmo)
Comment 26•9 years ago
|
||
(In reply to Glenn Randers-Pehrson from comment #25)
> We might want to allow users to disable SSE support for debugging or
> performance testing purposes.
There's no precedent for this in other libraries that we support. I think being able to to disable it from the moz.build files is probably sufficient.
Also, do you mind posting the performance results from these changes?
| Assignee | ||
Comment 27•9 years ago
|
||
There's precedent in the way ARM-NEON support has been handled by the PNG decoder, but I can easily get rid of the enable/disable feature for both ARM-NEON and INTEL-SSE2. I don't have performance results for Firefox but I've tested with an instrumented version of pngcrush, but I've got to rerun those with libpng-1.6.24 now.
| Assignee | ||
Comment 28•9 years ago
|
||
Rebased old-configure.in
Attachment #8778023 -
Attachment is obsolete: true
| Assignee | ||
Comment 29•9 years ago
|
||
(In reply to Jeff Muizelaar [:jrmuizel] from comment #26)
> Also, do you mind posting the performance results from these changes?
Here are some. There's a bigger effect with PAETH-filtered images, and
not much effect on typical icons:
pngcrush_183_uxxx Not SSE2 Optimized
pngcrush_183_usxx SSE2 Optimized
HRT means "High resolution timing", i.e., clock_gettime().
Linux 4.4.0-31-generic #50-Ubuntu
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609
Timing tests for firefox linux themes (10 times *.png)
pngcrush_183_uxxx: HRT time decode 0.2474, other 0.0739, total 0.3300 sec
pngcrush_183_usxx: HRT time decode 0.2444, other 0.0715, total 0.3245 sec
Timing tests for firefox branding (20 times *.png)
pngcrush_183_uxxx: HRT time decode 0.2300, other 0.0707, total 0.3096 sec
pngcrush_183_usxx: HRT time decode 0.2098, other 0.0545, total 0.2731 sec
Timing tests for W-rgb-M147.png (100000x159, PAETH filtered)
pngcrush_183_uxxx: HRT time decode 0.5648, other 0.1914, total 0.7563 sec
pngcrush_183_usxx: HRT time decode 0.4401, other 0.1927, total 0.6328 sec
Timing tests for W-rgba-M147.png (100000x159, PAETH filtered)
pngcrush_183_uxxx: HRT time decode 0.7682, other 0.2513, total 1.0195 sec
pngcrush_183_usxx: HRT time decode 0.5496, other 0.2524, total 0.8020 sec
SunOS 5.10 Generic_147441-13 i86pc i386 i86pc
gcc (GCC) 4.7.1
Timing tests for firefox linux themes (10 times *.png)
pngcrush_183_uxxx: HRT time decode 0.2910, other 0.0434, total 0.3451 sec
pngcrush_183_usxx: HRT time decode 0.2848, other 0.0437, total 0.3391 sec
Timing tests for firefox branding (20 times *.png)
pngcrush_183_uxxx: HRT time decode 0.2499, other 0.0367, total 0.2985 sec
pngcrush_183_usxx: HRT time decode 0.2467, other 0.0364, total 0.2948 sec
Timing tests for W-rgb-M147.png (100000x159, PAETH filtered)
pngcrush_183_uxxx: HRT time decode 0.7805, other 0.1473, total 0.9279 sec
pngcrush_183_usxx: HRT time decode 0.7699, other 0.1456, total 0.9156 sec
Timing tests for W-rgba-M147.png (100000x159, PAETH filtered)
pngcrush_183_uxxx: HRT time decode 1.0327, other 0.1962, total 1.2290 sec
pngcrush_183_usxx: HRT time decode 0.8255, other 0.1940, total 1.0196 sec
Comment 30•9 years ago
|
||
(In reply to Glenn Randers-Pehrson from comment #27)
> There's precedent in the way ARM-NEON support has been handled by the PNG
> decoder, but I can easily get rid of the enable/disable feature for both
> ARM-NEON and INTEL-SSE2.
Yeah, let's not add it for INTEL-SSE2. You can drop the ARM-NEON stuff in another bug. The patches mostly look good. In the next version of patch please only separate out the parts that are actually independent. e.g there's no point in splitting out the licensing changes from the other ones. I expect the whole thing probably makes the most sense as a single patch.
| Assignee | ||
Comment 31•9 years ago
|
||
Update to libpng-1.6.24
Attachment #8775998 -
Attachment is obsolete: true
Attachment #8775998 -
Flags: review?(jmuizelaar)
Attachment #8780163 -
Flags: review?(jmuizelaar)
| Assignee | ||
Comment 32•9 years ago
|
||
Combined patches, update to libpng-1.6.24, remove configuration and use INTEL_ARCHITECTURE instead.
Need another try run since so much is changed.
Attachment #8775786 -
Attachment is obsolete: true
Attachment #8776218 -
Attachment is obsolete: true
Attachment #8776439 -
Attachment is obsolete: true
Attachment #8776721 -
Attachment is obsolete: true
Attachment #8777870 -
Attachment is obsolete: true
Attachment #8778671 -
Attachment is obsolete: true
Attachment #8776218 -
Flags: review?(jmuizelaar)
Attachment #8776439 -
Flags: review?(jmuizelaar)
Attachment #8776721 -
Flags: review?(jmuizelaar)
Attachment #8777870 -
Flags: review?(jmuizelaar)
Flags: needinfo?(ryanvm)
Attachment #8780164 -
Flags: review?(jmuizelaar)
Comment 33•9 years ago
|
||
Comment on attachment 8780164 [details] [diff] [review]
v00-1276127-part02-sse-intree-libpng
Review of attachment 8780164 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good.
Attachment #8780164 -
Flags: review?(jmuizelaar) → review+
Comment 34•9 years ago
|
||
Comment on attachment 8780163 [details] [diff] [review]
v02-1276127-part01-add-sse-directory-to-intree-libpng
Review of attachment 8780163 [details] [diff] [review]:
-----------------------------------------------------------------
It would be fine to have joined both of these patches as one. Please use a single commit.
Attachment #8780163 -
Flags: review?(jmuizelaar) → review+
Comment 35•9 years ago
|
||
Folded and pushed to Try:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=1c663ca95bb7
Flags: needinfo?(ryanvm)
| Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 36•9 years ago
|
||
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/cdd3e16aebd4
Add SSE support to in-tree libpng. r=jrmuizel
Keywords: checkin-needed
Comment 37•9 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Updated•9 years ago
|
| Assignee | ||
Comment 38•9 years ago
|
||
This seems to have had no discernible effect on arewefastyet.com in mid-August (I don't know if AWFY tests png decoding or not, but it doesn't look that way).
Comment 39•9 years ago
|
||
arewefastyet only measures JS performance
You need to log in
before you can comment on or make changes to this bug.
Description
•