Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

astutils.cpp: always inline isMutableExpression() with Clang #6647

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

firewave
Copy link
Collaborator

@firewave firewave commented Jul 30, 2024

The function is too big to automatically be inlined. By forcing the inlining we mainly save the overhead associated with calling the function.

@firewave
Copy link
Collaborator Author

I forgot to publish the comment with the profiling data and I deleted the data. Will add it later.

@firewave firewave changed the title astutils.cpp: always inline isMutableExpression() astutils.cpp: always inline isMutableExpression() with Clang Jul 30, 2024
@firewave
Copy link
Collaborator Author

-D__GNUC__ --check-level=exhaustive ../lib/utils.cpp

Clang 17 883,924,504 -> 862,654,217
GCC 14 887,771,241 -> 883,432,056

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

Clang 17 8,155,725,690 -> 7,984,163,813
GCC 14 8,034,731,082 -> 8,002,352,248

@firewave firewave marked this pull request as ready for review July 31, 2024 12:06
@chrchr-github
Copy link
Collaborator

MSVC has __forceinline...

@firewave
Copy link
Collaborator Author

firewave commented Aug 2, 2024

MSVC has __forceinline...

Profiling Visual Studio has been difficult for me because it is time-based and has some confusing output which is not good if you are looking at short-running examples. Also I have not set up a build utilizing Boost yet.

But it has been a while and I should give it a spin again.

@firewave firewave merged commit b40f41b into danmar:main Aug 7, 2024
63 checks passed
@firewave firewave deleted the ismutable branch August 7, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants