Show HN: Bild – A collection of parallel image processing algorithms in Go
github.com
github.com
This looks like it could be used to re-implement a lot ImageMagick fairly easily. I love ImageMagick (well, except for hijacking really generic command names like 'convert' and 'identify'), but re-implementing those features in a memory managed language like Go is a real security bonus for servers processing images from untrusted sources. See ImageTragick.
What would slow something like this down is not using the relevant assembly code to accelerate working with these images. A very quick glance at the convolution package, chosen on the grounds that if anything is ASM it probably is, shows that this really is "pure Go", in the sense that it doesn't use Go's ASM support. The compiler will not optimize that to speak of, certainly there's no autovectorization, so it's going to be significantly slower than an optimized program that does make correct use of vectorized operations.
Though, in theory, this can be cleaned up over time. Go does have the support built-in for fixing that in a reasonably nice way, as long as you don't mind that it has its own assembler dialect.
[1]: Not 100% related, but close enough, the part towards the end: http://www.drdobbs.com/cpp/increasing-compiler-speed-by-over...
But assuming you represent and process your image as a packed slice of rgba or something, the gc wont be in your way at all.
Source: led team that built production go image resizing and conversion services at walmartlabs.
When processing millions of pixels, and deciding to tradeoff handwritten vector assembly for nice Go, it's valuable to know exactly how much performance we are losing in return.
This will hopefully also make performance regressions over time a bit more visible.
Check out benchmark suite, seems more comprehensive: https://github.com/jcupitt/libvips/wiki/Speed-and-memory-use
Also the name of Germany's biggest tabloid, which is a pitty, though...
A few caveats I ran into: 1) You are limited in how much /tmp on a Lambda instance can hold (512MB total). For the transcode I'm doing on these boxes, some of the videos are that size just to download. It will fail. I have a backup using the older method to handle these very large instances. 2) These, obviously, need a pretty decent amount of RAM to run.
But the benefits are really worth it for us. Elastic Transcoder, for our needs, was going to be >$15k/mo). Our current transcoder cost is around $400/mo. The previous, EC2-based iteration, was a step up for us, but it sometimes took a while to start. Doing it with Lambda has actually been less expensive, provided a faster experience for our customers, and was significantly easier to build than the EC2-based option.
Not bad for a project to see if I could write something in Go.
Sure, even if it’s on SSD, it’s still likely to be more expensive than local storage on the lambda instance, but that might still be better than using ec2.