Replies: 1 comment
-
I come from a background where performance is important and reading a file (or more files? help me out please) for each execution of each unit test doesn't sound that good when we are talking about unit tests which take microseconds to run. And to back up my data about how much time unit tests need, I did some benchmarks on some of our unit tests, the results:
After checking how much time does it need (on a Samsung 860 QVO) to check whether a file exists (it doesn't, randomized filename postfix), and it turns out it added around 3 μs overhead. And instead of checking for file existence, actually reading a 2.4 KB file added around 22 μs overhead but caching probably mislead me here so it should be more. So, to sum up, in my case, reading a file from an older SATA SSD (from 2019) added about two-three digits microseconds (XX-XXX μs) overhead per test execution. For tests that are already in the milliseconds range (i.e. using mocking frameworks or slower FluentAssertions methods), using this library probably won't be a problem (if you run your tests in parallel and you don't have many tens of thousands test cases). |
Beta Was this translation helpful? Give feedback.
-
Hi!
I think it would be important to have some documentation on the performance implications of using Verify altogether, as it would help the decision process of many people who are concerned about performance.
Beta Was this translation helpful? Give feedback.
All reactions