They provide the original source code using two arrays: sources (required) and sourcesContent (optional). Source maps are JSON files that map from compiled code back to the original code. Search for missing source map code on the file system ( #2711) I definitely should have caught these performance issues earlier. This work is now disabled when it's not going to be used. I likely haven't observed this before because esbuild's benchmarks always have source maps enabled. There was unnecessary work being done that was related to source maps when source map output was disabled. These were both very obvious in the profiler, so I think maybe I have just never profiled esbuild's CSS printing before? Apparently I forgot to move this part of esbuild's CSS infrastructure beyond the proof-of-concept stage. This is faster because identifiers are plain ASCII in the vast majority of cases, so Unicode decoding is almost always unnecessary.ĬSS identifiers and CSS strings were still being printed one character at a time. This was sped up using loop that skips UTF-8 decoding entirely and that only updates member variables once at the end. Advancing past each character involved UTF-8 decoding as well as updating multiple member variables. Identifiers were being scanned using a generic character advancement function instead of using custom inline code. The performance improvements were very straightforward: | Test case | Previous release | This release | Here's an example benchmark for using esbuild to pretty-print a single large minified CSS file and JS file: This release brings noticeable performance improvements for JS parsing and for CSS parsing and printing. Performance improvements for both JS and CSS
0 Comments
Leave a Reply. |