protolint
protolint copied to clipboard
Benchmarking support to find low-hanging optimizations?
Happy Thanksgiving! In the spirit, thank you for this wonderful linting tool.
How might I go about benchmarking protolint to improve the speed? I have 130 proto files, totaling 31 kLOC, and it takes about 3.4 seconds for protolint to check them. That means:
- protolint parses about 9 kLOC/second.
By comparison, Go compiles at about 44 kLOC/second, so I suspect there are opportunities to improve the parsing speed.
I'm interested because protolint is the slowest lint I've added to our repo by about 2x. I want to improve interactive performance for a better dev experience.
Here's the trace showing the performance of various lints:
I did a bit of profiling by adding pprof locally to protolint but didn't find anything conclusive. The majority of time is spent parsing. The rule execution only accounts for 2% of the time.