A small benchmarking lib

Etranger via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Wed Aug 2 00:35:59 PDT 2017


On Tuesday, 1 August 2017 at 09:02:17 UTC, Etranger wrote:
> Hi all,
>

Forgot to put an example output and it seems we cannot edit our 
previous messages.
So here is the output of the example in my previous post:

------------------------------------------------------------------------------------------------------------------------------------
            Benchmark name |                      Time/iter |      
       Best |           Worst |           Total |      Iterations |
------------------------------------------------------------------------------------------------------------------------------------
              test_fib_rec |     274.971 us (+/- 13.956 us) |      
271.525 us |      285.482 us |     3.73613 sec |             271 |
         test_fib_for_loop |                4 ns (+/- 0 ns) |      
       4 ns |            4 ns |    276.258 msec |         1169755 |
------------------------------------------------------------------------------------------------------------------------------------
{
     "BenchmarksResults": [
         {
             "mb_s": 0,
             "name": "test_fib_rec",
             "ns_iter_summ": {
                 "iqr": 4803.25,
                 "max": 285482.400000000023,
                 "mean": 276296.097999999998,
                 "median": 274971.5,
                 "median_abs_dev": 3091.221,
                 "median_abs_dev_pct": 1.12419687131211776,
                 "min": 271525.900000000023,
                 "quartiles": [
                     273139.75,
                     274971.5,
                     277943
                 ],
                 "std_dev": 4389.8878894842901,
                 "std_dev_pct": 1.5888345587436743,
                 "sum": 13814804.9000000004,
                 "var": 19271115.6822408326
             },
             "total_iterations": 271,
             "total_ns": 3736127769
         },
         {
             "mb_s": 0,
             "name": "test_fib_for_loop",
             "ns_iter_summ": {
                 "iqr": 0,
                 "max": 4,
                 "mean": 4,
                 "median": 4,
                 "median_abs_dev": 0,
                 "median_abs_dev_pct": 0,
                 "min": 4,
                 "quartiles": [
                     4,
                     4,
                     4
                 ],
                 "std_dev": 0,
                 "std_dev_pct": 0,
                 "sum": 200,
                 "var": 0
             },
             "total_iterations": 1169755,
             "total_ns": 276258388
         }
     ]
}

which shows better in a terminal :/





More information about the Digitalmars-d-announce mailing list