Ticket #12 (closed enhancement: fixed)
PyYAML is slow
|Reported by:||edemaine@…||Owned by:||xi|
Here are two simple wall-clock timings comparing PyYAML to PySyck on a Pentium 4 2.8GHz with 1MB cache and 1GB RAM:
$ wc file1.yaml 2036 8767 59154 file1 $ test.py file1.yaml 0:00:00.001419 to read the YAML via Syck 0:00:04.029627 to read the YAML via PyYAML $ wc file2.yaml 8949 35105 317342 file2 $ test.py file2.yaml 0:00:00.001564 to read the YAML via Syck 0:00:19.288912 to read the YAML via PyYAML
I do not expect PyYAML to be terribly competitive with Syck: the language barrier is big, and PyYAML is written with a higher level of abstraction. But I was surprised to see a factor of 12,000 difference. I wonder if a bit of profiling and tuning might reduce this gap to just a couple of orders of magnitude (100x) instead of four? Personally, 19 seconds to read a 0.3 meg file is too slow for my application, so I'll have to switch back to Syck for now, unfortunately. Just food for thought...