Closed edumbell closed 2 years ago
Hello!
Do you have a static lock around the main work?
Locks are used only at the instance level.
Any other suggestions much appreciated!
HtmlMinifier
instances (you can use the Microsoft.Extensions.ObjectPool library as a basis).
Hi, I am using an instance of WebMarkupMin.Core.HtmlMinifier 2.9 to minify a large number of emails but it is too slow. I see CPUs are barely being used, so tried to run the minification in e.g. a Parallel.For, but nothing I do improves performance or uses more CPUs. Do you have a static lock around the main work? Do you need that? I could understand if each instance has some contested resource, but it would be nice if we could construct an instance per thread and not have them interfere with each other.
I have also tried setting all "Minify..." and "Remove..." settings to false but it doesn't seem to improve performance at all. Any other suggestions much appreciated!