Message150928
The attached script benchmarks the basline (current implementation) against 3 new implementations, as suggested on http://mail.python.org/pipermail/python-ideas/2012-January/013296.html
On my machine, the output is:
merge_baseline
per run, min of 3 = 7.527 ms
merge_1
per run, min of 3 = 9.894 ms
131.449 % of baseline
merge_2
per run, min of 3 = 7.948 ms
105.594 % of baseline
merge_3
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:37 | ssapin | set | recipients:
+ ssapin, rhettinger |
2012-01-09 10:43:36 | ssapin | set | messageid: <1326105816.66.0.903535644472.issue13742@psf.upfronthosting.co.za> |
2012-01-09 10:43:36 | ssapin | link | issue13742 messages |
2012-01-09 10:43:35 | ssapin | create | |
|