Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUse piston_image instead of stb_image for decoding JPEGs #9790
Conversation
highfive
commented
Feb 28, 2016
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @SimonSapin (or someone else) soon. |
highfive
commented
Feb 28, 2016
|
Here are some performance numbers from this tool.
|
|
Don't those benchmarks suggest we should stick with |
|
@frewsxcv while it currently will be a performance regression, it will replace a C dependency with one written in Rust. jpeg-decoder is also quite new and most work this far has gone into getting it spec-compliant, so there's still some optimization left to be done. |
SGTM. I'll let someone else review though. |
|
With version 0.1.1 of jpeg-decoder, baseline decoding went from 149.80ms to 124.82ms. |
|
|
This comment in the removed code doesn’t seem to be addressed:
So this is regressing not only on performance, but also on functionality. Beyond that, I don’t feel I can make a decision about this. r? @metajack, you’ve been working on a JPEG decoder lately, haven’t you? |
|
@SimonSapin that comment is no longer relevant as piston-image 0.7 replaced it's in-tree JPEG decoder (which did not support progressive) with the jpeg-decoder crate (which does support progressive). So the Sorry for the confusion, the numbers you should be looking at are these:
|
|
Please squash and this is ready to merge. I tihnk regressing performance is ok, since we expect performance to improve and it wasn't "production quality" anyway. I am working on a new GPU assisted JPEG decoder which will hopefully be faster than state of the art. If down the line we can't make Piston's decoder fast and the GPU ideas don't pan out, we can just switch to a binding of libjpeg-turbo. +S-needs-squash Reviewed 12 of 12 files at r1. components/net_traits/image/base.rs, line 50 [r1] (raw file): I don't think your code did this, but could you flie a bug to fix this behavior? Comments from the review on Reviewable.io |
|
There is already #8406 regarding your concern about restricting supported file formats. It also seems to be fixed and should be closed? |
|
|
|
You're right. This was fixed. You can ignore my comment :) As soon as you rebase I'll r+. |
Bump image to 0.7
|
Rebased |
|
@bors-servo r=metajack |
|
|
Use piston_image instead of stb_image for decoding JPEGs The main reason stb_image was used for decoding JPEGs was the lack of progressive support in piston_image. With version 0.7, piston_image gained support for decoding progressive JPEGs through use of the [jpeg-decoder](https://crates.io/crates/jpeg-decoder) crate. This PR removes the dependency on stb_image and instead uses piston_image 0.7 for decoding JPEGs. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9790) <!-- Reviewable:end -->
|
|
kaksmet commentedFeb 28, 2016
The main reason stb_image was used for decoding JPEGs was the lack of progressive support in piston_image.
With version 0.7, piston_image gained support for decoding progressive JPEGs through use of the jpeg-decoder crate.
This PR removes the dependency on stb_image and instead uses piston_image 0.7 for decoding JPEGs.