Closed soininen closed 2 months ago
I just realized we can always fall back to dateutil.parser.parse()
if fromisoformat()
fails so we can stay backwards compatible.
By the way, this also improves parsing Map
s that have time stamps as indices considerably.
We could gain a lot in performance if we replaced
dateutil.parser.parse()
bydatetime.fromisoformat()
in theparameter_value
module.parameter_value
module currently usesdateutil.parser
to parse any string input. Its strength is that it can parse a wide variety of datetime formats. However, its flexibility seems to make it extremely slow, too.If I remember correctly,
datetutil.parser
was chosen for the job because, at that time, we were still supporting Python 3.7 which lackeddatetime.fromisoformat()
. It is available in Python 3,8, though, which is our current minimum Python version.fromisoformat()
is lightning fast compared todateutil.parser
, though it supports only ISO 8601. Still, the potential performance gains from supporting a single time format should overweight the loss of support for other formats.