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

Cache std::ostringstream between assertions. #939

Merged
merged 1 commit into from
Jun 25, 2017
Merged

Conversation

coombez
Copy link
Contributor

@coombez coombez commented Jun 23, 2017

This is not thread safe, but I think that was already true of Catch.
The construction/destruction of the std::ostringstream is where the
vast majority of time is spent per assertion. A simple test of
100000000 CHECK()s is reduced from around 60s to 7.4s

Description

GitHub Issues

This is not thread safe, but I think that was already true of Catch.
The construction/destruction of the std::ostringstream is where the
vast majority of time is spent per assertion.  A simple test of
100000000 CHECK()s is reduced from around 60s to 7.4s
@horenmar
Copy link
Member

Yeah, Catch Classic (1.x) is thread unsafe, because C++98 does not provide cross-platform facilities for dealing with threads...

Anyway, thanks I'll take a look later

@horenmar horenmar added the Tweak label Jun 24, 2017
@horenmar horenmar merged commit 396ecf6 into catchorg:master Jun 25, 2017
@coombez coombez deleted the perf branch June 26, 2017 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants