diff options
author | Raphael Gaschignard <raphael@rtpg.co> | 2020-11-16 10:31:37 +0900 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2020-11-16 07:41:57 +0100 |
commit | 9a5e1b349fd2521ef8eedaf92b16785c895aaefa (patch) | |
tree | 2bdeded7e117c314ab499005fab99c7d30cd617a /CONTRIBUTORS.txt | |
parent | e9b4f05434e76bde94e85f4445b6fe0cff321f6c (diff) | |
download | pylint-git-9a5e1b349fd2521ef8eedaf92b16785c895aaefa.tar.gz |
Avoid doing a regex search for line lengths unless necessary
Before this change, we would check a line for pylint: disable-style
pragmas to determine whether to check the line length. The regex
check itself is very costly (~5% of pylint's total runtime in one
codebase), and is much more costly than the check itself.
This refactors the pylint check to instead do an approximate line
length check on everything, before using the regex to handle
exceptional, false negative cases like pragmas being the cause for the line length
overflow.
This change, in one sample codebase, lowered the check_lines
runtime from 5% of the total runtime to 0.35% of the total runtime
Diffstat (limited to 'CONTRIBUTORS.txt')
-rw-r--r-- | CONTRIBUTORS.txt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 702af289a..12094a99e 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -427,3 +427,5 @@ contributors: * Takashi Hirashima: contributor * Joffrey Mander: contributor + +* Raphael Gaschignard: contributor |