trullock / NUglify

NUglify is a HTML, JavaScript and CSS minification Library for .NET (fork of AjaxMin + new features)
Other
396 stars 79 forks source link

[Feature] Support char[] Input and Output for CSS Minification #398

Open DOWEBGit opened 5 months ago

DOWEBGit commented 5 months ago

It would be beneficial if NUglify could support char[] as both input and output for the CSS/JS minification process. This would help minimize memory allocations and optimize performance.

The char[] can be rent from a pool.

Input: Allow char[] array as input for the Uglify.Css method. Output: Return the minified result as a char[] array, ensuring minimal memory allocation.

Example Usage:

char[]` cssInput = ... // CSS input as a char array`

UglifyResult result = Uglify.Css(cssInput);

char[] minifiedCssOutput = result.MinifiedContentAsCharArray;

Benefits: Reduced Memory Allocation: Avoids extra allocations from converting between char[] and string.

Performance Improvement: Enhances performance, especially for large CSS files.

Thank you

trullock commented 5 months ago

NUglify was never memory optimised , but you're welcome to submit a PR