proselint icon indicating copy to clipboard operation
proselint copied to clipboard

[feature-proposal] faster startup

Open orgua opened this issue 5 months ago • 0 comments

as this linter can be used by IDEs and it is called repeatingly, the startup-overhead should be minimized. benchmarking the whole program vs the next deeper routine:

############# lint_path(demo.md) - Linux, 147 checks
parallel took 71.520 ms -> run0
parallel took 78.004 ms -> run1
parallel took 80.381 ms -> run2
parallel-cached took 1.847 ms -> run0
parallel-cached took 1.336 ms -> run1
parallel-cached took 1.252 ms -> run2

############# proselint(demo.md) - parallel, Linux, 147 checks
parallel took 166.188 ms
parallel-cached took 64.538 ms

Comparing the <2ms vs. 64 ms from the cached runs shows it best. Profiling reveals that some of it is caused by click. As the project does not need much cli-magic it would be best to use basic builtins instead of click. Performance should also improve when regex-str of "static" checks are precompiled into patters and memoized.

orgua avatar Jan 22 '24 15:01 orgua