← Back to team overview

dolfin team mailing list archive

Benchmark for GenericMatrix with and wihtout template

 

I have added a benchmark to src/test/main.cpp. It compares the speed
of assemblhy for 2D Poisson on a 128 x 128 mesh repeated 100
times. Here are some typical timings:

Time with template:    4.23
Time without template: 4.24

Time with template:    4.24
Time without template: 4.21

Time with template:    4.2
Time without template: 4.29

Time with template:    4.22
Time without template: 4.24

Time with template:    4.22
Time without template: 4.15

Sometimes the templated version wins and sometimes the non-templated
wins, so I'd say there is no overhead of removing the templating. The
advantage would be that FEM and other implementations can be
simplified and more code moved to .cpp from .h.

Garth, maybe you can check the benchmark and see if you agree with the
results. I've compiled with --enable-optimization.

/Anders



Follow ups