Closed LeadAssimilator closed 3 years ago
I didn't do extensive benchmarking on the parser with large files, not sure how to interpret the given description in any empirical sense being it is heavily context-dependent, but adding the compiled flag will be a simple fix. It will add some load time to the assembly, but it should be insignificant for all the more there are.
As of https://github.com/ForeverZer0/SharpNBT/commit/f27bebf6c9057ab6e2ba9e3726d5911b176c1ab7, regular expressions used in the library use the Compiled
flag.
There is also a release for this version, which will likely be updated on NuGet by the time this message is seen.
The SNBT parser appears to rely heavily on Regex but the regexes aren't compiled.
Specifying the RegexOptions.Compiled in the Regex constructor will yield a massive speedup.