Skip to content

Defer error message evaluation for swift matchers#1210

Open
firesteps wants to merge 2 commits into
Quick:mainfrom
firesteps:defer-error-message-evaluation
Open

Defer error message evaluation for swift matchers#1210
firesteps wants to merge 2 commits into
Quick:mainfrom
firesteps:defer-error-message-evaluation

Conversation

@firesteps

Copy link
Copy Markdown
  • Defer error message evaluation until expectation fails.
    • Matchers and Sync/AsyncExpectation evaluate error messages eagerly which leads to String(describing:) calls even when expectation passes. In modules with a large number of types this call is expensive. In some of our modules the test run profiling shows 30-90% of CPU time is spent in String(describing:) for the work that's discarded when expectation passes. The largest improvement I've measured is a test suite run dropping from 60s to 5s.
  • Error messages are not changed.
  • Add tests to check if String(describing:) was called by introducing type with a CustomStringConvertible implementation.
  • PR doesn't affect public API and doesn't change Objective-C matchers

Important

Linux support is not tested due to #981

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