Performance Testing in XCode Playgrounds
/Update I have made this available as a Swift Package (including Linux support) on GitHub so that it can be integrated into non-playground projects too.
I have been using unit tests to test performance of algorithms since the introduction of XCode 6. However, they are quite heavy weight for quickly experimenting with a couple of difference approaches.
To overcome this I've created this little playground that has a similar function to the "measurePerformance" function in XCT. You can download it here
The method measure can simply take a block that you wish to test, and it will return the average time taken to execute the block over 10 iterations
That's useful, but you might be interested in seeing all of the results (or possibly testing a few different algorithms. So, you can also provide a name for your test that will cause a graph to be plotted of the execution times of each iteration as well as the average time and standard deviation
A few notes... it's much better to supply your test code in the playground sources (cmd-0 to see them with the example playground) as it means you won't be getting the playground incremental updates slowing down the actual execution.
It's a great way of quickly iterating on different solutions to a problem you have, and making sure you have a fast implementation!
Great finds
- Casino Non Aams
- Non Gamstop Casinos
- UK Casinos Not On Gamstop
- Betting Sites
- Casino Not On Gamstop
- Casino Non Aams Legali
- UK Casino Not On Gamstop
- Sports Betting Sites Not On Gamstop UK
- Best Casinos Not On Gamstop UK
- Non Gamstop Casinos
- Non Gamstop Casinos
- Online Casino Sin Licencia
- Casino Sites UK
- Casino Online Italia
- UK Casino Sites Not On Gamstop
- Gambling Sites Not On Gamstop
- Casinos En Ligne
- Non Gamstop Casinos
- Non Gamstop Casino UK
- Best Non Gamstop Casino