panthomakos/timezone — pull request #11 by nessche (2012-05-14 21:09:36+00:00)
Title: Changed rule_for_reference to use timestamps where possible

Hi,
while hunting for the DST bug, I noticed that the code was parsing strings also when timestamps were present, so I slightly changed the rule_for_reference code to use timestamps, if present. I tried executing rule_for_reference 10000 times in a row, and it shows that using timestamps is roughly 9 times faster than parsing a string with strptime.

The existing tests are now using the new functionality, and I added a new test (and a data without timestamps) to test the case where no timestamps are available.

If during the existence of this library you have already found a reason why timestamps should not be used, just discard this pull request.