]> git.baikalelectronics.ru Git - kernel.git/commit
gen_compile_commands: parse only the first line of .*.cmd files
authorMasahiro Yamada <masahiroy@kernel.org>
Sat, 22 Aug 2020 14:56:09 +0000 (23:56 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 26 Aug 2020 15:44:33 +0000 (00:44 +0900)
commit0519033e8a12487368a10cca09b6b71926db318a
tree19cf8b56d9cca1837b7d4f42c9d6593f9f54e224
parentf9be99065c323ad3c5534a756e320ebbe0b01227
gen_compile_commands: parse only the first line of .*.cmd files

After the allmodconfig build, this script takes about 5 sec on my
machine. Most of the run-time is consumed for needless regex matching.

We know the format of .*.cmd file; the first line is the build command.
There is no need to parse the rest.

With this optimization, now it runs 4 times faster.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
scripts/gen_compile_commands.py