esonderegger / fecfile

a python parser for the .fec file format
https://esonderegger.github.io/fecfile/
Apache License 2.0
44 stars 13 forks source link

Perf increase #27

Closed freedmand closed 3 years ago

freedmand commented 3 years ago

Patch in changes for increasing the performance of the FEC file parser.

Ensured the unit tests still pass. To enable faster date parsing, include {'simple_conversion': True} in the options to bypass int conversion and convert datetimes to strings that look like YYYY-MM-DD (from YYYYMMDD), which speeds up conversion significantly.

freedmand commented 3 years ago

Not quite ready yet — closing for now

esonderegger commented 3 years ago

Hi @freedmand ! Most of these performance changes look like great ideas - thanks for working on this!

I'm totally happy to leave this open while it's still in development. Please let me know when it's ready for me to take a look.

I'm intrigued by the idea of there being a middle ground between the as_string option, which does no type conversion, and converting everything to native python types (which I think should remain the default). I'm curious about your use case - I think a discussion about this could yield improvements to how options are handled.