A quick glance suggests that the generated converter from pyudunits2 (which uses sympylambdify) is significantly quicker than the one that is generated by udunits2 (used within cf-units). However, this performance doesn't shine until you have a lot of data to convert (e.g. 5000250012 data points). Before that, the cost of reading the XML, parsing, etc. is much higher in pyudunits2. It would be good to micro-benchmark this so that we can focus on speeding things up at pinch points.
I had the following scripted hacked together to roughly compare:
A quick glance suggests that the generated converter from pyudunits2 (which uses
sympy
lambdify
) is significantly quicker than the one that is generated byudunits2
(used withincf-units
). However, this performance doesn't shine until you have a lot of data to convert (e.g. 5000250012 data points). Before that, the cost of reading the XML, parsing, etc. is much higher inpyudunits2
. It would be good to micro-benchmark this so that we can focus on speeding things up at pinch points.I had the following scripted hacked together to roughly compare:
With results along the lines of: