Bug 430959

Summary: Building with clazy is at least 2x slower than without clazy
Product: [Developer tools] clazy Reporter: Elvis Angelaccio <elvis.angelaccio>
Component: generalAssignee: Unassigned bugs <unassigned-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: smartins
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Elvis Angelaccio 2020-12-29 22:00:14 UTC
Since recently clazy has started to slow down my compile times quite a lot. Building e.g. dolphin with clazy enabled takes at least twice the time than building it with clazy disabled or with gcc.

I have clang 11 on archlinux but another user on IRC reported the same issue with clang 10 on Neon.

What else should be checked?
Comment 1 Sergio Martins 2020-12-30 01:12:53 UTC
A git bisect would be useful ?

Is it only repro with master, or 1.8 branch too ?
If only master then it's easy to bisect, as only a few commits when in recently
Comment 2 Elvis Angelaccio 2020-12-31 16:19:39 UTC
I have the 1.8 branch from the archlinux package. I'll try to bisect...
Comment 3 Elvis Angelaccio 2021-01-09 19:20:01 UTC
I tried to bisect but there are a lot of revisions that do not build :(

I can at least confirm that 1.7 is not affected.
Comment 4 Sergio Martins 2021-01-09 21:24:12 UTC
Which checks do you have enabled ?
Comment 5 Sergio Martins 2021-01-09 23:57:44 UTC
reproduced
Comment 6 Sergio Martins 2021-01-10 00:17:43 UTC
Git commit 0215389de14f5bc6daa5d6e6e5d3943c0aba9584 by Sergio Martins.
Committed on 10/01/2021 at 00:14.
Pushed by smartins into branch '1.8'.

Revert "Add fixit for copyable-polymorphic"

This reverts commit d6b07989e7a9211b21ecb9b9f8bd4d237bcc453e.
It's causing a 4x slowdown.

The culprit is running AccessSpecifierManager::VisitDeclaration
for all classes, instead of QObject only

Will reapply in master with a possible workaround

M  +2    -17   src/AccessSpecifierManager.cpp
M  +0    -3    src/AccessSpecifierManager.h
M  +1    -54   src/checks/level2/copyable-polymorphic.cpp
M  +0    -1    src/checks/level2/copyable-polymorphic.h
M  +0    -5    tests/copyable-polymorphic/config.json
M  +0    -9    tests/copyable-polymorphic/main.cpp
M  +0    -1    tests/copyable-polymorphic/main.cpp.expected
D  +0    -72   tests/copyable-polymorphic/main.cpp.fixed.expected

https://invent.kde.org/sdk/clazy/commit/0215389de14f5bc6daa5d6e6e5d3943c0aba9584
Comment 7 Sergio Martins 2021-01-10 00:21:59 UTC
Git commit acb72c6165c5213a2d6d2e631d091751faaa43fc by Sergio Martins.
Committed on 10/01/2021 at 00:21.
Pushed by smartins into branch 'master'.

Merge branch '1.8'


https://invent.kde.org/sdk/clazy/commit/acb72c6165c5213a2d6d2e631d091751faaa43fc