Comments (8)
On a side note, I'm not sure this streaming approach is faster than if a singular GM command was built. Performance hasn't been so good compared to the old image server code so far.
from image-resizer.
What sort of setup are you seeing these long processing times on? Also what size of images are you using?
My dev setup (Macbook Air) does not show any significant slowdowns that I have seen. The typical use case at least for resizing images off of s3 was for file sizes of less than 5mb, are you processing images larger than that?
I would prefer to keep the original images being processed by the resize stream so we can auto-orient and remove the meta data. I will investigate performance though, if you could give me some parameters to test against that would be cool (image, setup etc).
In regards to streaming, much of what I did in this newer API was to cut out all the bottlenecks we were seeing previously. Writing to disk, especially on Heroku is slow and inconsistent and pushing data back to s3 was also very inconsistent. Keeping things in memory have thus far appeared to be a big win in both speed and efficiency. Using the CDN more effectively (removing the 302 redirects) was also a big step forward.
from image-resizer.
A 3mb PNG file on our dual-core VPS took about 15 seconds until I put that
code in to skip the resize stream and then it was down to about 200ms.
Interestingly, resizing down to 150px wide only took about 6 seconds. If
you email me at my username @ gmail.com I'll reply with the specific file I
used.
On Tue, Jun 24, 2014 at 11:02 AM, James Nicol [email protected]
wrote:
What sort of setup are you seeing these long processing times on? Also
what size of images are you using?My dev setup (Macbook Air) does not show any significant slowdowns that I
have seen. The typical use case at least for resizing images off of s3 was
for file sizes of less than 5mb, are you processing images larger than that?I would prefer to keep the original images being processed by the resize
stream so we can auto-orient and remove the meta data. I will investigate
performance though, if you could give me some parameters to test against
that would be cool (image, setup etc).In regards to streaming, much of what I did in this newer API was to cut
out all the bottlenecks we were seeing previously. Writing to disk,
especially on Heroku is slow and inconsistent and pushing data back to s3
was also very inconsistent. Keeping things in memory have thus far appeared
to be a big win in both speed and efficiency. Using the CDN more
effectively (removing the 302 redirects) was also a big step forward.—
Reply to this email directly or view it on GitHub
#14 (comment)
.
Jonathan
from image-resizer.
So I am still working on this but I have seen quite an improvement in using PngQuant instead of Optipng. For me the bottleneck was by far the optimize section, I was seeing things like this...
HEAD /elocal-h1000/test/sample_images/dont-version-invision.png 200 33049ms - 1.05mb
[resizer] new stream created!
[resizer] local filesystem - 4ms
[resizer] identify: no identify
[resizer] resize - 2317ms
[resizer] filter: none requested
[resizer] optimize:png - 28816ms
[resizer] original image size: 3008.838kb
[resizer] size saving: 63.26%
[resizer] checksum 274c6d9c9a44a50baa1d8a39a6287b525609fdda
PngQuant reduced the optimize time down to around 2700ms for the same request which is nice. What I dont understand yet is why the resize time is still lengthy and why that is your bottleneck.
from image-resizer.
Thanks for taking a look at this. PngQuant is lossy, so it's also not an
option for us because image fidelity is our business.
-Jonathan
On Wed, Jun 25, 2014 at 1:11 AM, James Nicol [email protected]
wrote:
So I am still working on this but I have seen quite an improvement in
using PngQuant instead of Optipng. For me the bottleneck was by far the
optimize section, I was seeing things like this...HEAD /elocal-h1000/test/sample_images/dont-version-invision.png 200 33049ms - 1.05mb
[resizer] new stream created!
[resizer] local filesystem - 4ms
[resizer] identify: no identify
[resizer] resize - 2317ms
[resizer] filter: none requested
[resizer] optimize:png - 28816ms
[resizer] original image size: 3008.838kb
[resizer] size saving: 63.26%
[resizer] checksum 274c6d9c9a44a50baa1d8a39a6287b525609fddaPngQuant reduced the optimize time down to around 2700ms for the same
request which is nice. What I dont understand yet is why the resize time is
still lengthy and why that is your bottleneck.—
Reply to this email directly or view it on GitHub
#14 (comment)
.
Jonathan
from image-resizer.
So I tried a bunch of different things to try and smooth the original images through the resizer. I tried both returning a stream and buffer and it didnt seem to make much difference (actually very little).
Still no matter what I did the optimize step on my setup was bigger always the bottleneck. Switching to pngquant did obviously make a big difference, but given your use case precludes it I set the png optimizer to be a flag now. env.PNG_OPTIMIZER
will allow you to select pngquant, optipng or null for nothing.
To skip the resize action for original images there is also a flag env.RESIZE_PROCESS_ORIGINAL
which is a boolean.
I will continue to think about making this faster, but for now you should be able to configure your instance to meet your needs.
from image-resizer.
Oh all this is in v0.9.0
from image-resizer.
Thanks, I really appreciate your efforts!
On Thu, Jun 26, 2014 at 12:07 AM, James Nicol [email protected]
wrote:
Oh all this is in v0.9.0
—
Reply to this email directly or view it on GitHub
#14 (comment)
.
Jonathan
from image-resizer.
Related Issues (20)
- Black background when converting png to jpg HOT 1
- Using it for s3 compatible third party buckets (but not provided by amazon) HOT 1
- app crashes on jpg image HOT 11
- Please add additional logging when using EXTERNAL_SOURCE_* HOT 1
- Unable to disable Chalk coloured output HOT 2
- Update sharp dependency to v0.12.0 HOT 3
- How to run it in production mode on AWS HOT 3
- Installation Error HOT 5
- 'The specified key does not exist.' error when used behind Nginx. HOT 2
- 'The specified key does not exist.' when accessing image 3 folders deep. HOT 2
- crashes when empty input HOT 1
- Is this project dead? HOT 2
- Random error HOT 2
- Is this repo dead? HOT 1
- Image Quality HOT 1
- Use of lovell/sharp/master/preinstall.sh is deprecated, will be removed at end of 2016 HOT 1
- High severity vulnerability affecting this repo
- Can't make a route other than root '/' HOT 2
- looks lossy HOT 5
- Does not work with proxy
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from image-resizer.