2
Reply

What is the objective of code benchmarking and what it does

Tridip Bhattacharjee

Tridip Bhattacharjee

Sep 12 2017 8:21 AM
186

just from this url https://www.hanselman.com/blog/ExperimentsInOpenSourceExploringVcrsharpForHttpRecordAndPlayback.aspx

i came to know there is a library which people may use to code bench marking but i do not understand what is code bench marking and when to use it?

what kind of output and benefit i can expect from code bench marking ?

  1. [Benchmark]  
  2. public async Task ReadFromCache()  
  3. {  
  4.   
  5.     using (var httpClient = HttpClientFactory.WithCassette("example-test"))  
  6.     {  
  7.         var request = new HttpRequestMessage(HttpMethod.Get, "http://www.iana.org/domains/reserved");  
  8.         var response = await httpClient.SendAsync(request);  
  9.     }  

 
  1. Output:  
  2.   
  3.         Method |     Mean |    Error |   StdDev |  
  4. -------------- |---------:|---------:|---------:|  
  5.  ReadFromCache | 684.1 us | 3.154 us | 2.796 us | 
 

when i see the output just do not understand what it is showing........so anyone tell me what kind of output it is ?

where this output will be showing in console or debug window ?

please share the knowledge about code bench marking. thanks

 

Answers (2)