cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

findtoken.h: make sure code is being matchcompiled

Open firewave opened this issue 1 year ago • 4 comments

firewave avatar Jul 26 '24 06:07 firewave

-D __GNUC__ --check-level=exhaustive lib/utils.cpp

Clang 18 851,620,331 -> 809,036,639 GCC 14 880,259,918 -> 841,976,696

This should help with https://trac.cppcheck.net/ticket/12271.

Detecting match calls in headers is tracked in https://trac.cppcheck.net/ticket/11541.

This is obviously extremely horrible and needs to be done differently. Because templates are involved I could not come up with something better for now - but because of the sizable impact I published it anyways.

firewave avatar Jul 26 '24 06:07 firewave

The example from https://trac.cppcheck.net/ticket/10765#comment:4.

Clang 17 8,156,089,970 -> 7,669,984,764

firewave avatar Jul 29 '24 16:07 firewave

@pfultz2 Care to have a look at this? Thanks!

firewave avatar Jul 29 '24 18:07 firewave

The example from https://trac.cppcheck.net/ticket/10765#comment:4.

Clang 17 3,753,065,367 -> 3,237,960,965

This makes a lot of difference and we really need to figure out how to get this change in properly.

firewave avatar Aug 28 '24 10:08 firewave

I do not want the changes to go in this way but I am marking this for review so I hopefully get some more feedback on how to resolve this.

firewave avatar Dec 14 '24 13:12 firewave

-D __GNUC__ --check-level=exhaustive lib/utils.cpp

Clang 19 699,175,113 -> 652,340,049 GCC 14 744,553,244 -> 702,309,116

The example from https://trac.cppcheck.net/ticket/10765#comment:4.

Clang 19 3,624,176,882 -> 3,063,883,851 GCC 14 3,884,644,414 -> 3,374,187,145

callgrind in the CI 63,702,930,187 -> 63,303,081,301

firewave avatar Dec 22 '24 17:12 firewave

nice speedups! I am curious.. do you have any theory why there is speedup it just looks like a refactoring to me?

danmar avatar Jan 01 '25 22:01 danmar

nice speedups! I am curious.. do you have any theory why there is speedup it just looks like a refactoring to me?

The Token::Match() calls were not matchcompiled because they lived in a header. See previous discussion here.

firewave avatar Jan 01 '25 22:01 firewave

The Token::Match() calls were not matchcompiled because they lived in a header. See previous discussion here.

ah yes! :+1:

danmar avatar Jan 01 '25 22:01 danmar

@pfultz2 does this look okay to you?

firewave avatar Jan 04 '25 18:01 firewave

Thanks. I think I addressed all of it.

firewave avatar Jan 04 '25 19:01 firewave