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:
18 files changed
+296
-187
No files matched your search
@@ -58,6 +58,8 @@ namespace Catch {
|
||||
return m_start[index];
|
||||
}
|
||||
|
||||
bool operator<(StringRef const& rhs) const noexcept;
|
||||
|
||||
public: // named queries
|
||||
constexpr auto empty() const noexcept -> bool {
|
||||
return m_size == 0;
|
||||
@@ -91,7 +93,6 @@ namespace Catch {
|
||||
auto operator += ( std::string& lhs, StringRef const& sr ) -> std::string&;
|
||||
auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&;
|
||||
|
||||
|
||||
constexpr auto operator "" _sr( char const* rawChars, std::size_t size ) noexcept -> StringRef {
|
||||
return StringRef( rawChars, size );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user