This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ssapin
Recipients rhettinger, ssapin
Date 2012-01-09.10:43:35
SpamBayes Score 0.0017232283
Marked as misclassified No
Message-id <>
The attached script benchmarks the basline (current implementation) against 3 new implementations, as suggested on

On my machine, the output is:

    per run, min of 3 = 7.527 ms
    per run, min of 3 = 9.894 ms
    131.449 % of baseline
    per run, min of 3 = 7.948 ms
    105.594 % of baseline
    per run, min of 3 = 7.581 ms
    100.716 % of baseline

On this particular input, merge_2 adds 6% of overhead when the key parameter is not used. While merge_3 only adds 1% of overhead, it almost doubles the amount of code. (Which was admittedly not that long to begin with.)

The patch in the previous message is with the merge_2 implementation, which seemed like the best compromise to me.
Date User Action Args
2012-01-09 10:43:37ssapinsetrecipients: + ssapin, rhettinger
2012-01-09 10:43:36ssapinsetmessageid: <>
2012-01-09 10:43:36ssapinlinkissue13742 messages
2012-01-09 10:43:35ssapincreate