Hello everyone,
As I'm currently working on mesh issues in TELEMAC Python scripts, I've taken the time to do some benchmarks, not only on mesh reading, but also on mesh writing and memory consumption when writing to another file, as I'm also trying to solve a problem that Nicolas Godet encountered when trying to merge several huge meshes.
I did my benchmark on f3d_malpasset-murd_p6.slf, which is a TELEMAC-3D results file of about 5 MB. Here are my results:
xarray with SELAFIN backend
Mesh reading: 0.05676 seconds
Mesh writing: 0.06217 seconds
Memory consumption when writing: 10.65 MB
TelemacFile with HERMES
Mesh reading: 0.00771 seconds
Mesh writing: 0.02675 seconds
Memory consumption when writing: 17.10 MB
PyTelTools
Mesh reading: 0.05070 seconds
Mesh writing: 0.05185 seconds
Memory consumption when writing: 5.79 MB
Here we can clearly see that TelemacFile with HERMES still outperforms the other solutions in terms of I/O performance. However, we can also see that TelemacFile is not optimised at all in terms of memory usage when we need to copy a SELAFIN file to another file, as it uses two memory buffers: one for the original file and one for the output file. PyTelTools does a better job here, as it is designed to copy frames in chunks.