Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SerializedSyntaxSet: Load cache data early; only parse lazily
The slow part is parsing, so we can load the data from the file during startup without a big performance hit. The benefit of loading the data during startup is that we can better detect when the cache is incomplete, and fallback to data from the binary. In particular, this change makes the following scenario fallback to syntaxes.bin from the binary during startup (same behavior as current bat), rather than panicing when we try to lazily load syntaxes.bin that does not exist: bat cache --build --source assets rm ~/.cache/bat/syntaxes.bin bat any-file > /tmp/out.txt
- Loading branch information