Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal/catch_test_failure_exception.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2023-02-20 10:22:37 +0100
committerMartin Hořeňovský2023-02-20 15:19:57 +0100
commit584973a485160bea0feb8764c28bb65d03b988ac (patch)
tree90ff607f09c5f9e4ac10d3608d18ac3e35b1ccb1 /src/catch2/internal/catch_test_failure_exception.cpp
parent4f7c8cb28a0fdb4cc8b93f139b1b1e5d3ff0a328 (diff)
downloadcatch3-584973a485160bea0feb8764c28bb65d03b988ac.tar.gz
Early evaluate line loc in NameAndLoc::operator==
I do not know if checking the tracker name or the tracker's file part of the location first would provide better results, but in the common case, the line part of the location check should be rather unique, because different `SECTION`s will have different source lines where they are defined. I also propagated this same check into `ITracker::findChild`, because this significantly improves performance of section tracking in Debug builds -> 10% in macro benchmark heavily focused on section tracking. In Release build there is usually no difference, because the inliner will inline `NameAndLoc::operator==` into `findChild`, and then eliminate the redundant check. (If the inliner decides against, then this still improves the performance on average).
Diffstat (limited to 'src/catch2/internal/catch_test_failure_exception.cpp')
0 files changed, 0 insertions, 0 deletions