Open zzjin opened 3 years ago
Interesting. Would you be willing to do some profiling to start identifying where the difference comes from?
working on it. But it's bit hard and take more time to find. @see https://github.com/libvips/libvips/issues/1931 https://github.com/libvips/libvips/issues/1919
at this moment,
1: vips_concurrency_set(0)
will have better perf, but still slow than pure go, about ~8ms upspeed.<- Here still have some discussion in govips/libvips/bimg issue. https://github.com/jcupitt/libvips/issues/261#issuecomment-92850414 https://github.com/libvips/libvips/issues/639
access:VIPS_ACCESS_SEQUENTIAL
just for resize and thumbnail will significant speed up, but in real use we cannot open SEQUENTIAL
just as govips is do not.(vips_pngload_buffer
without more params is random
mode).vips_pngsave_buffer
api, so vips_pngload_buffer
and composite
just take 0.x ms. <-working on this.
Any suggestion will be good.Hey @zzjin. Thanks a million for the valuable work you're doing.
We do have a PR cooking up that will bring streaming mode to govips: https://github.com/davidbyttow/govips/pull/135
Otherwise I think optimising 15 milliseconds from such an operation sounds tricky. Likely not any single issue you can fix but more optimising lots of small things. All would start from the profiling I guess.
@zzjin, Just want to note that the resulting output between imaging.Fill()
and (*ImageRef).Thumbnail()
are distinctly different. (with similar parameters, as shown above). In my testing, the result of Thumbnail
fills better (more interesting), and is much closer to what I expect. (and would account for the difference in time)
Do you see similar visual results with both libraries?
Hi there:
I found strage and wired speed perf using govips and pure go package to thumbnail image. test code show here:
run script:
when test with repo's image files:
seems when deal png, libvips's version is 35% slower?
PS1: I've searched issues from govips and bimg and libvips founds, it seems to be the
Concurrency
|vips_concurrency_set
related issue?PS2: in real case I use
CompositeMulti
and the perf issue grow, which means when I composite 16 images together and save it to file, govips/libvips takes about 2x time. so given code is simplify just for start digg.