Pro Tip: Running FeedValidator and ScheduleViewer faster

The Google-supported transitfeed Python package includes several useful tools, including a Feed Validator and Schedule Viewer… But under Python they’re slow. With a moderately sized feed (Santa Clara VTA), it’s problematic:

python2.7 transitfeed-1.2.15/feedvalidator_googletransit.py vta/ > /dev/null
103.32s user 4.67s system 75% cpu 2:22.28 total

That took 103 seconds to run. Larger feeds take exponentially more time. What to do?

Enter pypy, a faster version of Python– written in Python. The differences are puzzling, but explained here. The same code run under pypy is much faster:

pypy transitfeed-1.2.15/feedvalidator_googletransit.py vta/ > /dev/null
30.48s user 3.05s system 74% cpu 44.928 total

30% of the time to do the same work.

Leave a Reply

Your email address will not be published. Required fields are marked *