Comment 7 for bug 207604

Revision history for this message
Petr Machata (pmachata) wrote :

Rodrigo,

I'm attaching the patch for what's described in comment #5. I've done some measurements, and the import takes less time than in the upstream package:
$ for i in `seq 1 50`; do PYTHONPATH=. python /home/petr/hle.py; done | python -c 'import sys; print sum (float (i) for i in sys.stdin)'
1.06896305084

With upstream pytz, I get:
$ for i in `seq 1 50`; do PYTHONPATH=. python -c 'import time;x=time.time();import pytz;print time.time()-x'; done | python -c 'import sys; print sum (float (i) for i in sys.stdin)'
3.13412761688

So that does help quite a bit. The code relies on system tzdata, meaning it might also be easier to keep it up to date.