ImageSharp
ImageSharp copied to clipboard
6-7 second save for webp on azure server
Prerequisites
- [X] I have written a descriptive issue title
- [X] I have verified that I am running the latest version of ImageSharp
- [X] I have verified if the problem exist in both
DEBUGandRELEASEmode - [X] I have searched open and closed issues to ensure it has not already been reported
ImageSharp version
2.1.0
Other ImageSharp packages and versions
SixLabors.ImageSharp.Formats.Webp;
Environment (Operating system, version and so on)
Windows Azure Service App
.NET Framework version
6.0 .net core
Description
When I run SaveAsWebp() on my dev machine.. 300ms
When I run on an Azure App service (1cpu/1.75GB mem) it takes 6-7 seconds. Jpg encoder is fast on App service
image.SaveAsWebp(memoryStream, new WebpEncoder() { Quality = quality, Method = WebpEncodingMethod.BestQuality, FileFormat = WebpFileFormatType.Lossy, });
Is there some additional IO that could be stalling the process? seems weird its only happening for webp.
Interested to hear your thoughts!
Steps to Reproduce
deploy simple app that calls SaveAsWebp() on azure app service.
Images
No response
@HappyCatKitten do you know what CPU's are used in Azure App service? Do they support hardware intrinsics like SSE2 or AVX2? If not, that could be the cause of the difference.
The other thing is, BestQuality is actually expected to be slow. You should only use this method, if encoding times does not really matter. The encoding is actually done multiple times with different strategies and then the best (= the one with the least amount of bytes is picked). Maybe trying the Default encoding method would be worth a try.
Hey @HappyCatKitten can you please answer the above question?
I'm gonna close this. It's been months without reply