5 ms·
> I had a few Python scripts that spend several seconds parsing larger files, after a rewrite to c++ that changed to almost instant. It depends on the task. If
by dmortin 6y ago
> I had a few Python scripts that spend several seconds parsing larger files, after a rewrite to c++ that changed to almost instant.
It depends on the task. If the parsing is done once a day then several seconds is nothing, so there is no point in using C++.
If the parser is running very frequently then of course one uses a faster implementation.
- josefx 6y agoIn my case it lead to a reverse on that reasoning. The script ended up being an explicit step to import the data when it changed instead of running implicitly whenever the data was needed. Of course that choice was based on the initial version which was even slower and didn't use multiprocessing to handle the files in parallel.