rizsotto / Bear

Bear is a tool that generates a compilation database for clang tooling.
GNU General Public License v3.0
4.76k stars 312 forks source link

Bear 3 is very slow #436

Closed delamonpansie closed 2 years ago

delamonpansie commented 2 years ago

Bear 3 is very slow.

It takes about 1 minute to run bear2 on my linux kernel. I killed bear3 after 15 minutes of waiting.

How To Reproduce

$ wget -q -O - https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.11.tar.xz | tar Jxf -
$ cd linux-5.15.11
$ make defconfig >/dev/null
$ /usr/local/bin/bear --version
bear 2.3.13
$ time /usr/local/bin/bear make -j32 >/dev/null

real    0m44,190s
user    17m0,864s
sys 1m54,277s
$ make clean >/dev/null
$ /usr/bin/bear --version                                                                                                                        
bear 3.0.8
$ time /usr/bin/bear -- make -j32 >/dev/null                                                                                                     
^C
real    29m36,101s
user    29m39,070s
sys 9m17,201s                                                                                          

bear2 is built from source, bear3 is default bear in Debian bullseye.

rizsotto commented 2 years ago

The performance issue you have with 3.0.8 is solved. Can you try the latest version?

delamonpansie commented 2 years ago
$ /usr/local/bin/bear --version
bear 3.0.18
$ time /usr/local/bin/bear -- make -j32 >/dev/null

real    1m44,806s
user    21m29,944s
sys 3m21,450s

It works, thanks. Perhaps you could give a hint for a Debian package maintainer. Unfortunately, it is still twice as slow compared to bear2.

rizsotto commented 2 years ago

That's a good news @delamonpansie ! See this thread about packaging.

Yes, the new version is slower, but has more features. Working on to improve it.