10.12 Creating Performance Benchmark Tests with NTime
Let’s get one thing straight before jumping into NTime, a handy performance benchmarking tool written by Adam Slosarski: performance benchmarking is a difficult thing to get right, and you can easily get distracted by and fixated on over-optimization. Developers, leads, and architects concerned with performance measuring need to have a good grip on how to go about such measuring. Steve McConnell’s Code Complete, Second Edition has a wealth of great information on how and when to worry about optimization.
Rants and disclaimers aside, NTime lets you easily write timing tests for your software. Its look and feel is very similar to that of NUnit, complete with similar attributes for marking test fixtures and test methods. NTime lets you test against duration or number of hits to a method or make use of Windows Performance Monitor probes. There’s also a simple GUI for running timing tests.
NTime isn’t a profiler; you’ll need to look to other tools for that. NTime is simply a quick way to set time or performance boundaries on your software so that you can flag potential problem areas.
Get Windows Developer Power Tools now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.