Performance Testing with NBench
@angella_andrea
www.dotnetalgorithms.com
Andrea Angella
Set your performance goals first!
There is no point in testing performance if you don’t know
what to measure and what goals you want to achieve
What is NBench?
Framework for automatic benchmarking and
performance testing for .NET applications
Born from real needs
First public release on December 2015
Aaron Stannard
CTO of Petabridge
Co-founder of Akka.NET
Designed with best practices in mind
• Warm up processor cache
• Benchmark on a single processor
• Use StopWatch
• Set high priority for the process and thread in your application
• Collect all garbage
• Running a target benchmark for several times
• Use a prime number of iterations
• ….
http://blogs.perpetuumsoft.com/dotnet/learn-how-to-create-correct-c-benchmarks/
Why NBench?
• Holistic performance testing framework for .NET
• Help you to avoid performance regressions
• Designed with best practices in mind
• Works and feels a lot like a unit testing
• Easy to use
• Can be integrated with your build pipeline
• Generate reports so you can track how performance changed over time
What can I test?
Code Throughput
Memory allocations
GC overhead
DEMO 1 – THROUGHPUT TESTS
DEMO 2 – MEMORY TESTS
DEMO 3 – GARBAGE COLLECTION TESTS
DEMO 4 – NUNIT INTEGRATION
RESOURCES
GitHub Project
https://github.com/petabridge/NBench
Introduction to Nbench
https://petabridge.com/blog/introduction-to-nbench/
Gitter
https://gitter.im/petabridge/NBench
NBench Vision
Complete, user-friendly and fully extensible framework
for automatic performance testing in .NET
Make automatic performance testing a
regular software development practice!
Thanks
@angella_andrea
www.dotnetalgorithms.com
Andrea Angella

Performance testing with NBench

  • 1.
    Performance Testing withNBench @angella_andrea www.dotnetalgorithms.com Andrea Angella
  • 2.
    Set your performancegoals first! There is no point in testing performance if you don’t know what to measure and what goals you want to achieve
  • 3.
    What is NBench? Frameworkfor automatic benchmarking and performance testing for .NET applications Born from real needs First public release on December 2015 Aaron Stannard CTO of Petabridge Co-founder of Akka.NET
  • 4.
    Designed with bestpractices in mind • Warm up processor cache • Benchmark on a single processor • Use StopWatch • Set high priority for the process and thread in your application • Collect all garbage • Running a target benchmark for several times • Use a prime number of iterations • …. http://blogs.perpetuumsoft.com/dotnet/learn-how-to-create-correct-c-benchmarks/
  • 5.
    Why NBench? • Holisticperformance testing framework for .NET • Help you to avoid performance regressions • Designed with best practices in mind • Works and feels a lot like a unit testing • Easy to use • Can be integrated with your build pipeline • Generate reports so you can track how performance changed over time
  • 6.
    What can Itest? Code Throughput Memory allocations GC overhead
  • 7.
    DEMO 1 –THROUGHPUT TESTS
  • 8.
    DEMO 2 –MEMORY TESTS
  • 9.
    DEMO 3 –GARBAGE COLLECTION TESTS
  • 10.
    DEMO 4 –NUNIT INTEGRATION
  • 11.
    RESOURCES GitHub Project https://github.com/petabridge/NBench Introduction toNbench https://petabridge.com/blog/introduction-to-nbench/ Gitter https://gitter.im/petabridge/NBench
  • 12.
    NBench Vision Complete, user-friendlyand fully extensible framework for automatic performance testing in .NET Make automatic performance testing a regular software development practice!
  • 13.