Skip to content

optimized std::stack usage in simplecpp::TokenList::combineOperators()#659

Open
firewave wants to merge 2 commits into
cppcheck-opensource:masterfrom
firewave:combine
Open

optimized std::stack usage in simplecpp::TokenList::combineOperators()#659
firewave wants to merge 2 commits into
cppcheck-opensource:masterfrom
firewave:combine

Conversation

@firewave

@firewave firewave commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator
  • use std::vector as underlying container for std::stack
  • initialize std::stack with initial value instead of inserting it

@firewave

firewave commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

This cuts the Ir for the function in question in half.

Running ./testrunner in valgrind:

GCC 16 - 73,545,066 -> 73,089,626 -> 72,638,322
Clang 22 - 71,260,479 -> 70,736,809 -> 70,321,207

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.

1 participant