question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Benchmarks and commentary

See original GitHub issue

Loads a large tiff image, shrinks by 10%, sharpens, and saves again. On this test NetVips is around 15 times faster than Magick.NET and 6 times faster than ImageSharp.

ImageSharp doesn’t support Tiff but you know this already.

I’m curious about the sharpening phase of the test. Passing .75F to the ImageSharp GaussianSharpen algorithm will create a kernel with a radius of 3. Does net-vips adjust the dimensions of the input kernel to match that radius when dividing by 8?

https://github.com/kleisauke/net-vips/blob/0da155bba0c9cdd981a9bf5f4ddeb50e4b1bd011/tests/NetVips.Benchmarks/Benchmark.cs#L44

https://github.com/kleisauke/net-vips/blob/0da155bba0c9cdd981a9bf5f4ddeb50e4b1bd011/tests/NetVips.Benchmarks/Benchmark.cs#L83

The resize phase definitely differs. Both ImageSharp and Skia are using sampling algorithms that sample more surrounding pixels than the linear sampler used in the net-vips code. I cannot comment on Magick.NET implementation as I do not know the internals.

https://github.com/kleisauke/net-vips/blob/0da155bba0c9cdd981a9bf5f4ddeb50e4b1bd011/tests/NetVips.Benchmarks/Benchmark.cs#L43

I absolutely love a bit of healthy competition and it’s really nice to see others interested in the space.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jcupittcommented, Jun 6, 2019

@kleisauke Oh, I’d completely forgotten that. Yes, it would be an interesting experiment.

@JimBobSquarePants that just happens automatically with demand-driven processing, no wizardry heh.

1reaction
jcupittcommented, Jun 6, 2019

This is an nice thread, thank you both for the interesting discussion.

On speed, the libvips binary is usually built with dcommander’s fantastic libjpeg-turbo, which is typically 3x faster than the regular IJG libjpeg. This could explain a large part of the difference, as you say @JimBobSquarePants.

libvips is able to run the decompress and compress operations at the same time, so it gets a factor of two on compress/decompress speed there.

libvips does run-time code generation for convolution: it looks at the convolution mask and the image, and writes a short mmx/sse/neon/etc. program, depending on the host CPU, to compute the result.

It does the same thing for the vertical part of resize, though not the horizontal, unfortunately. From memory, excluding jpg decompress/recompress, about 60% of libvips runtime on this test is in these two or three lines of unvectorised code 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding benchmarking | Commentary and insights
"Benchmarking is a systematic and continuous measurement process; a process of continuously measuring and comparing an organisation's business processes against ...
Read more >
Benchmark: What It Is, Types, and How to Use Them in ...
A benchmark is a standard against which something is compared. Investors use benchmarks to measure the performance of securities, mutual funds, ...
Read more >
Understanding Benchmarks
With benchmarks today covering all types of assets and investment strategies, investors should carefully consider the underlying risks in a benchmark, or index, ......
Read more >
Understanding the Purpose and Use of Benchmarking
Benchmarking is a process for obtaining a measure – a benchmark. Simply stated, benchmarks are the “what,” and benchmarking is the “how.” But ......
Read more >
Benchmarking in Organizations | Atención Primaria
The entire benchmarking process comprises four fundamental steps: planning or observation, data collection or research, analysis or comprehension of the results ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found