.Net application development specialists
asp.net, c#, vb.net, html, javascript, jquery, html, xhtml, css, oop, design patterns, sql server, mvc and much more
contact: admin@paxium.co.uk

Paxium is the company owned by myself, Dave Amour and used for providing IT contract development services including


  • Application development - Desktop, Web, Services - with Classic ASP, Asp.net WebForms, Asp.net MVC, Asp.net Core
  • Html, Css, JavaScript, jQuery, React, C#, SQL Server, Ado.net, Entity Framework, NHibernate, TDD, WebApi, GIT, IIS
  • Database schema design, implementation & ETL activities
  • Website design and hosting including email hosting
  • Training - typically one to one sessions
  • Reverse Engineering and documentation of undocumented systems
  • Code Reviews
  • Performance Tuning
  • Located in Cannock, Staffordshire
Rugeley Chess Club Buying Butler Cuckooland Katmaid Pet Sitting Services Roland Garros 60 60 Golf cement Technical Conformity Goofy MaggieBears Vacc Track Find Your Smart Phone eBate Taylors Poultry Services Lafarge Rebates System Codemasters Grid Game eBate DOFF

Benchmarking in C#

Have you ever seen those posts people put where they have done some kind of performance tests, or benchmarking, against a couple of methods  - ususally doing the same thing but in different ways?

The ones that look like this

These are actually pretty easy to do and useful if you need to analyse and tune performance critical code

You need to create a class that exposes the 2 methods you want to benchmark something like this

You need to make sure the methods use some input value.  This would normally be passed in as arguments but for this we need to make sure a runtime value is provided.

You then declare your methods with [BenchMark] which comes from this nuget package

And then you just run the code in release code without debugging.

It will take a while as it performs many iterations then you will get the results.

The results in this case show that Linq is more readable but slower.  So which you choose depends on performance considerations.

You can also use [Params] as below to provide more varied input.