joepie91/python-whois

Strange performance characteristics

joepie91 opened this issue · 0 comments

After implementing a much-needed optimization (pre-compiling regexes), I found that not only does pythonwhois now parse much faster in Python 2.x, it is now also significantly faster than in Python 3.x. This should not be the case. Timing results below:

Prior to optimization

2.6
Timing in default mode: 333ms avg, 152ms min, 476ms max
Timing in normalized mode: 336ms avg, 130ms min, 482ms max

2.7
Timing in default mode: 283ms avg, 101ms min, 444ms max
Timing in normalized mode: 287ms avg, 109ms min, 453ms max

3.3
Timing in default mode: 78ms avg, 4ms min, 180ms max
Timing in normalized mode: 80ms avg, 4ms min, 338ms max

After optimization

2.6
Timing in default mode: 30ms avg, 1ms min, 135ms max
Timing in normalized mode: 30ms avg, 1ms min, 132ms max

2.7
Timing in default mode: 18ms avg, 0ms min, 82ms max
Timing in normalized mode: 18ms avg, 0ms min, 84ms max

3.3
Timing in default mode: 79ms avg, 3ms min, 178ms max
Timing in normalized mode: 79ms avg, 4ms min, 178ms max