mirror of
https://github.com/catchorg/Catch2.git
synced 2025-09-24 13:35:40 +02:00
Store tags in one big pre-allocated string and only work with refs
This should decrease the number of allocations before main is entered significantly, but complicates the code somewhat in return. Assuming I used `massif` right, doing just `SelfTest --list-tests` went from 929 allocations at "Remove gcc-4.9 from the travis builds" (2 commits up), to 614 allocations with this commit.
This commit is contained in:
@@ -43,9 +43,11 @@ namespace Catch {
|
||||
{}
|
||||
|
||||
bool TestSpec::TagPattern::matches( TestCaseInfo const& testCase ) const {
|
||||
return std::find(begin(testCase.lcaseTags),
|
||||
end(testCase.lcaseTags),
|
||||
m_tag) != end(testCase.lcaseTags);
|
||||
return std::find_if(begin(testCase.tags),
|
||||
end(testCase.tags),
|
||||
[&](Tag const& tag) {
|
||||
return tag.lowerCased == m_tag;
|
||||
}) != end(testCase.tags);
|
||||
}
|
||||
|
||||
bool TestSpec::Filter::matches( TestCaseInfo const& testCase ) const {
|
||||
|
Reference in New Issue
Block a user