Skip to content

Benchmarking your system

Thomas Nipen edited this page Oct 16, 2022 · 4 revisions

If certain gridpp functions are not running as fast as expected, you can try to run the gridpp benchmark script, which is located here: https://github.com/metno/gridpp/blob/master/tests/benchmark.py.

Run the script as follows:

python benchmark.py

The script runs a set of gridpp functions, computes the time required, and compares this to what is expected. Here is an example output:

Gridpp benchmark (gridpp version 0.6.0)
Expected results from Intel i7 3.40 Ghz
-----------------------------------------------------------------
Function                             Expected     Time     Diff
Grid 1000²                               0.74     0.79     6.92 %
neighbourhood 10000²                     2.05     2.27    10.97 %
neighbourhood 2000² max                  0.99     1.03     4.25 %
neighbourhood_quantile_fast 2000²        1.23     1.20    -2.14 %
neighbourhood_quantile 500²              1.70     1.62    -4.62 %
bilinear 1000²                           1.68     1.56    -6.86 %
bilinear 1000² x 50                      4.42     4.07    -7.85 %
nearest 1000²                            1.52     1.37    -9.83 %
nearest 1000² x 50                       1.93     1.88    -2.39 %
gridding 1000² 100000                    0.53     0.54     1.22 %
gridding_nearest 1000² 100000            0.13     0.13     2.69 %
optimal_interpolation 1000² 1000         1.57     1.94    23.80 %
dewpoint 1e7                             0.53     0.63    18.52 %
fill 1e5                                 0.52     0.52     0.81 %
doping_square 1e5                        0.16     0.13   -19.21 %
doping_circle 1e5                        0.52     0.54     3.85 %
local_distribution_correction            0.52     0.64    22.12 %
full_gradient 1000²                      1.59     1.44    -9.39 %
neighbourhood_search 2000² 7x7           1.11     1.05    -5.83 %
window 1000²                             1.67     1.80     8.07 %
gamma_inv 5*201*476                      1.17     1.58    35.59 %
apply_curve                              0.06     0.05   -15.04 %
apply_curve gridded                      0.87     1.02    16.67 %
test_vec3_input                          0.35     0.34    -3.89 %

The expected times are based on a 3.4GHz Intel i7 processor. Most likely, your results will either be consistently faster or slower than the benchmark. You can also test the parallelization performance of the code. Just invoke the -j2 argument (which will compare running on 1 and 2 cores). Note that not all functions scale well.

Clone this wiki locally