Improve performance of MPL Function and refactor

First three commits address performance optimizations of MPL Function and the last one is extracting common code for MPL Function and FunctionParameter into ParameterLib (including the optimizations).

  1. Tests covering your feature were added? Existing tests
  2. Any new feature or behaviour change was documented?

Some performance measurements

on a TH2M test using multiple MPL Function properties.

The measurements start with ufz/master d29.., and then for each commit and the final one 351.. is refactoring.

Single omp thread performance:

> cat d29fac0ea7e1e2ae3781931de50c01d8b231b69e.perf-stat.1 69e7d69131726a546d6af6d374df03372a3b6952.perf-stat.1 2a90d2bb1eeab2fa9d2dcb415df6d3ebc0e7abf3.perf-stat.1 1e09ec5ef352d452b080a389df17aa4bbaf7f86b.perf-stat.1 351b67edc2c1d682eef681905b998ca98278dc30.perf-stat.1

 Performance counter stats for '/home/naumov/w/ogs/r/bin/ogs /data/a/scratch/20260216_BGR_performance_benchmarks/Model_1/MODEL_1_RESOLUTION_1m.prj -o /tmp' (10 runs):

    94,351,066,881      task-clock:u                     #    1.003 CPUs utilized               ( +-  0.14% )
                 0      context-switches:u               #    0.000 /sec                      
                 0      cpu-migrations:u                 #    0.000 /sec                      
            11,101      page-faults:u                    #  117.656 /sec                        ( +-  1.64% )
   942,139,068,129      instructions:u                   #    2.38  insn per cycle            
                                                  #    0.04  stalled cycles per insn     ( +-  0.04% )  (71.41%)
   395,416,717,497      cycles:u                         #    4.191 GHz                         ( +-  0.16% )  (71.42%)
    38,752,668,182      stalled-cycles-frontend:u        #    9.80% frontend cycles idle        ( +-  1.33% )  (71.44%)
   144,748,933,968      branches:u                       #    1.534 G/sec                       ( +-  0.06% )  (71.46%)
       271,306,062      branch-misses:u                  #    0.19% of all branches             ( +-  0.93% )  (71.45%)
   485,833,744,102      L1-dcache-loads:u                #    5.149 G/sec                       ( +-  0.03% )  (71.43%)
    21,266,812,888      L1-dcache-load-misses:u          #    4.38% of all L1-dcache accesses   ( +-  0.76% )  (71.41%)

            94.035 +- 0.137 seconds time elapsed  ( +-  0.15% )


 Performance counter stats for '/home/naumov/w/ogs/r/bin/ogs /data/a/scratch/20260216_BGR_performance_benchmarks/Model_1/MODEL_1_RESOLUTION_1m.prj -o /tmp' (10 runs):

    84,355,419,312      task-clock:u                     #    1.004 CPUs utilized               ( +-  0.12% )
                 0      context-switches:u               #    0.000 /sec                      
                 0      cpu-migrations:u                 #    0.000 /sec                      
            11,781      page-faults:u                    #  139.659 /sec                        ( +-  1.89% )
   875,527,595,076      instructions:u                   #    2.47  insn per cycle            
                                                  #    0.04  stalled cycles per insn     ( +-  0.04% )  (71.43%)
   354,056,509,949      cycles:u                         #    4.197 GHz                         ( +-  0.11% )  (71.42%)
    31,497,659,754      stalled-cycles-frontend:u        #    8.90% frontend cycles idle        ( +-  1.05% )  (71.41%)
   126,149,101,726      branches:u                       #    1.495 G/sec                       ( +-  0.06% )  (71.42%)
       196,676,881      branch-misses:u                  #    0.16% of all branches             ( +-  1.97% )  (71.44%)
   452,145,801,391      L1-dcache-loads:u                #    5.360 G/sec                       ( +-  0.03% )  (71.46%)
    16,902,393,983      L1-dcache-load-misses:u          #    3.74% of all L1-dcache accesses   ( +-  0.83% )  (71.45%)

            84.044 +- 0.106 seconds time elapsed  ( +-  0.13% )


 Performance counter stats for '/home/naumov/w/ogs/r/bin/ogs /data/a/scratch/20260216_BGR_performance_benchmarks/Model_1/MODEL_1_RESOLUTION_1m.prj -o /tmp' (10 runs):

    77,808,748,294      task-clock:u                     #    1.004 CPUs utilized               ( +-  0.19% )
                 0      context-switches:u               #    0.000 /sec                      
                 0      cpu-migrations:u                 #    0.000 /sec                      
            11,575      page-faults:u                    #  148.762 /sec                        ( +-  2.26% )
   828,669,557,178      instructions:u                   #    2.54  insn per cycle            
                                                  #    0.04  stalled cycles per insn     ( +-  0.05% )  (71.46%)
   325,897,544,718      cycles:u                         #    4.188 GHz                         ( +-  0.16% )  (71.43%)
    31,648,561,573      stalled-cycles-frontend:u        #    9.71% frontend cycles idle        ( +-  1.35% )  (71.40%)
   118,218,453,562      branches:u                       #    1.519 G/sec                       ( +-  0.07% )  (71.40%)
       126,216,290      branch-misses:u                  #    0.11% of all branches             ( +-  2.20% )  (71.41%)
   419,854,566,255      L1-dcache-loads:u                #    5.396 G/sec                       ( +-  0.06% )  (71.44%)
    17,617,953,698      L1-dcache-load-misses:u          #    4.20% of all L1-dcache accesses   ( +-  0.35% )  (71.47%)

            77.488 +- 0.147 seconds time elapsed  ( +-  0.19% )


 Performance counter stats for '/home/naumov/w/ogs/r/bin/ogs /data/a/scratch/20260216_BGR_performance_benchmarks/Model_1/MODEL_1_RESOLUTION_1m.prj -o /tmp' (10 runs):

    75,252,281,870      task-clock:u                     #    1.004 CPUs utilized               ( +-  0.14% )
                 0      context-switches:u               #    0.000 /sec                      
                 0      cpu-migrations:u                 #    0.000 /sec                      
            11,542      page-faults:u                    #  153.377 /sec                        ( +-  2.31% )
   804,165,484,533      instructions:u                   #    2.55  insn per cycle            
                                                  #    0.04  stalled cycles per insn     ( +-  0.06% )  (71.42%)
   315,753,341,688      cycles:u                         #    4.196 GHz                         ( +-  0.15% )  (71.46%)
    29,644,149,027      stalled-cycles-frontend:u        #    9.39% frontend cycles idle        ( +-  0.58% )  (71.47%)
   113,201,571,526      branches:u                       #    1.504 G/sec                       ( +-  0.08% )  (71.44%)
       119,610,693      branch-misses:u                  #    0.11% of all branches             ( +-  2.25% )  (71.42%)
   408,839,613,618      L1-dcache-loads:u                #    5.433 G/sec                       ( +-  0.03% )  (71.40%)
    17,373,425,408      L1-dcache-load-misses:u          #    4.25% of all L1-dcache accesses   ( +-  0.67% )  (71.39%)

            74.927 +- 0.109 seconds time elapsed  ( +-  0.15% )


 Performance counter stats for '/home/naumov/w/ogs/r/bin/ogs /data/a/scratch/20260216_BGR_performance_benchmarks/Model_1/MODEL_1_RESOLUTION_1m.prj -o /tmp' (10 runs):

    75,404,172,098      task-clock:u                     #    1.004 CPUs utilized               ( +-  0.15% )
                 0      context-switches:u               #    0.000 /sec                      
                 0      cpu-migrations:u                 #    0.000 /sec                      
            11,232      page-faults:u                    #  148.957 /sec                        ( +-  1.29% )
   805,628,764,395      instructions:u                   #    2.55  insn per cycle            
                                                  #    0.03  stalled cycles per insn     ( +-  0.04% )  (71.42%)
   315,736,727,969      cycles:u                         #    4.187 GHz                         ( +-  0.13% )  (71.39%)
    26,958,420,000      stalled-cycles-frontend:u        #    8.54% frontend cycles idle        ( +-  1.07% )  (71.39%)
   113,258,244,570      branches:u                       #    1.502 G/sec                       ( +-  0.05% )  (71.42%)
       123,499,897      branch-misses:u                  #    0.11% of all branches             ( +-  1.95% )  (71.46%)
   410,947,120,455      L1-dcache-loads:u                #    5.450 G/sec                       ( +-  0.04% )  (71.47%)
    17,343,470,307      L1-dcache-load-misses:u          #    4.22% of all L1-dcache accesses   ( +-  0.51% )  (71.46%)

            75.090 +- 0.111 seconds time elapsed  ( +-  0.15% )

16 omp threads performance:

> cat d29fac0ea7e1e2ae3781931de50c01d8b231b69e.perf-stat.16 69e7d69131726a546d6af6d374df03372a3b6952.perf-stat.16 2a90d2bb1eeab2fa9d2dcb415df6d3ebc0e7abf3.perf-stat.16 1e09ec5ef352d452b080a389df17aa4bbaf7f86b.perf-stat.16 351b67edc2c1d682eef681905b998ca98278dc30.perf-stat.16

 Performance counter stats for '/home/naumov/w/ogs/r/bin/ogs /data/a/scratch/20260216_BGR_performance_benchmarks/Model_1/MODEL_1_RESOLUTION_1m.prj -o /tmp' (10 runs):

   159,502,218,495      task-clock:u                     #   15.671 CPUs utilized               ( +-  0.52% )
                 0      context-switches:u               #    0.000 /sec                      
                 0      cpu-migrations:u                 #    0.000 /sec                      
            13,622      page-faults:u                    #   85.403 /sec                        ( +-  1.68% )
 1,113,369,700,941      instructions:u                   #    1.73  insn per cycle            
                                                  #    0.03  stalled cycles per insn     ( +-  0.21% )  (71.43%)
   642,647,126,089      cycles:u                         #    4.029 GHz                         ( +-  0.49% )  (71.43%)
    38,127,677,330      stalled-cycles-frontend:u        #    5.93% frontend cycles idle        ( +-  1.25% )  (71.43%)
   200,572,233,375      branches:u                       #    1.257 G/sec                       ( +-  0.36% )  (71.42%)
       288,458,134      branch-misses:u                  #    0.14% of all branches             ( +-  0.82% )  (71.43%)
   541,692,221,935      L1-dcache-loads:u                #    3.396 G/sec                       ( +-  0.15% )  (71.44%)
    18,452,435,786      L1-dcache-load-misses:u          #    3.41% of all L1-dcache accesses   ( +-  0.93% )  (71.44%)

           10.1780 +- 0.0511 seconds time elapsed  ( +-  0.50% )


 Performance counter stats for '/home/naumov/w/ogs/r/bin/ogs /data/a/scratch/20260216_BGR_performance_benchmarks/Model_1/MODEL_1_RESOLUTION_1m.prj -o /tmp' (10 runs):

   145,067,466,002      task-clock:u                     #   15.640 CPUs utilized               ( +-  0.14% )
                 0      context-switches:u               #    0.000 /sec                      
                 0      cpu-migrations:u                 #    0.000 /sec                      
            13,272      page-faults:u                    #   91.488 /sec                        ( +-  3.10% )
 1,030,710,894,443      instructions:u                   #    1.77  insn per cycle            
                                                  #    0.03  stalled cycles per insn     ( +-  0.12% )  (71.43%)
   581,344,355,592      cycles:u                         #    4.007 GHz                         ( +-  0.13% )  (71.43%)
    31,583,180,162      stalled-cycles-frontend:u        #    5.43% frontend cycles idle        ( +-  1.01% )  (71.43%)
   176,896,654,842      branches:u                       #    1.219 G/sec                       ( +-  0.21% )  (71.42%)
       219,312,200      branch-misses:u                  #    0.12% of all branches             ( +-  1.17% )  (71.43%)
   502,971,233,101      L1-dcache-loads:u                #    3.467 G/sec                       ( +-  0.09% )  (71.44%)
    15,004,782,610      L1-dcache-load-misses:u          #    2.98% of all L1-dcache accesses   ( +-  2.10% )  (71.43%)

            9.2752 +- 0.0125 seconds time elapsed  ( +-  0.14% )


 Performance counter stats for '/home/naumov/w/ogs/r/bin/ogs /data/a/scratch/20260216_BGR_performance_benchmarks/Model_1/MODEL_1_RESOLUTION_1m.prj -o /tmp' (10 runs):

   136,555,858,785      task-clock:u                     #   15.620 CPUs utilized               ( +-  0.13% )
                 0      context-switches:u               #    0.000 /sec                      
                 0      cpu-migrations:u                 #    0.000 /sec                      
            13,944      page-faults:u                    #  102.112 /sec                        ( +-  0.67% )
   981,844,558,664      instructions:u                   #    1.79  insn per cycle            
                                                  #    0.03  stalled cycles per insn     ( +-  0.07% )  (71.43%)
   547,644,608,010      cycles:u                         #    4.010 GHz                         ( +-  0.13% )  (71.43%)
    30,511,606,108      stalled-cycles-frontend:u        #    5.57% frontend cycles idle        ( +-  0.46% )  (71.42%)
   168,267,353,541      branches:u                       #    1.232 G/sec                       ( +-  0.11% )  (71.42%)
       147,931,057      branch-misses:u                  #    0.09% of all branches             ( +-  1.17% )  (71.43%)
   469,626,918,996      L1-dcache-loads:u                #    3.439 G/sec                       ( +-  0.06% )  (71.44%)
    15,313,655,794      L1-dcache-load-misses:u          #    3.26% of all L1-dcache accesses   ( +-  0.77% )  (71.44%)

            8.7425 +- 0.0108 seconds time elapsed  ( +-  0.12% )


 Performance counter stats for '/home/naumov/w/ogs/r/bin/ogs /data/a/scratch/20260216_BGR_performance_benchmarks/Model_1/MODEL_1_RESOLUTION_1m.prj -o /tmp' (10 runs):

   134,223,732,636      task-clock:u                     #   15.609 CPUs utilized               ( +-  0.46% )
                 0      context-switches:u               #    0.000 /sec                      
                 0      cpu-migrations:u                 #    0.000 /sec                      
            13,500      page-faults:u                    #  100.578 /sec                        ( +-  1.85% )
   958,718,415,160      instructions:u                   #    1.78  insn per cycle            
                                                  #    0.03  stalled cycles per insn     ( +-  0.21% )  (71.42%)
   538,515,676,124      cycles:u                         #    4.012 GHz                         ( +-  0.47% )  (71.42%)
    28,445,535,346      stalled-cycles-frontend:u        #    5.28% frontend cycles idle        ( +-  0.52% )  (71.43%)
   163,373,057,356      branches:u                       #    1.217 G/sec                       ( +-  0.35% )  (71.44%)
       135,924,960      branch-misses:u                  #    0.08% of all branches             ( +-  1.91% )  (71.44%)
   458,680,101,250      L1-dcache-loads:u                #    3.417 G/sec                       ( +-  0.14% )  (71.43%)
    15,431,708,188      L1-dcache-load-misses:u          #    3.36% of all L1-dcache accesses   ( +-  0.67% )  (71.42%)

            8.5990 +- 0.0383 seconds time elapsed  ( +-  0.45% )


 Performance counter stats for '/home/naumov/w/ogs/r/bin/ogs /data/a/scratch/20260216_BGR_performance_benchmarks/Model_1/MODEL_1_RESOLUTION_1m.prj -o /tmp' (10 runs):

   134,265,103,709      task-clock:u                     #   15.616 CPUs utilized               ( +-  0.20% )
                 0      context-switches:u               #    0.000 /sec                      
                 0      cpu-migrations:u                 #    0.000 /sec                      
            13,308      page-faults:u                    #   99.117 /sec                        ( +-  2.04% )
   958,651,694,742      instructions:u                   #    1.77  insn per cycle            
                                                  #    0.03  stalled cycles per insn     ( +-  0.10% )  (71.44%)
   540,427,197,817      cycles:u                         #    4.025 GHz                         ( +-  0.19% )  (71.43%)
    27,780,537,279      stalled-cycles-frontend:u        #    5.14% frontend cycles idle        ( +-  1.16% )  (71.43%)
   163,240,875,873      branches:u                       #    1.216 G/sec                       ( +-  0.16% )  (71.42%)
       139,261,233      branch-misses:u                  #    0.09% of all branches             ( +-  1.36% )  (71.42%)
   460,183,165,437      L1-dcache-loads:u                #    3.427 G/sec                       ( +-  0.07% )  (71.43%)
    15,511,517,027      L1-dcache-load-misses:u          #    3.37% of all L1-dcache accesses   ( +-  1.27% )  (71.44%)

            8.5980 +- 0.0167 seconds time elapsed  ( +-  0.19% )
Edited by Dmitri Naumov

Merge request reports

Loading
Loading