Timing and aspect oriented programming (Was Re: Equivalent of Perl chomp?)

Huaiyu Zhu huaiyu at gauss.almadan.ibm.com
Fri Feb 1 14:51:51 EST 2002


The results I gave earlier was not quite right: the first part of the numbers
was pasted from an earlier run which loops over ten times as much.

Following are comparible numbers in a more readable format.

Using [-1:]
----plain old test ---

slice endswith
 0.0196  0.0268
 0.0196  0.0267
 0.0195  0.0345
 0.0196  0.0269
 0.0195  0.0269

endswith slice
 0.0270  0.0195
 0.0270  0.0194
 0.0269  0.0194
 0.0268  0.0197
 0.0275  0.0198
---- aspect test ---

slice endswith
 0.0778  0.1017
 0.0772  0.0874
 0.0773  0.0874
 0.0773  0.0934
 0.0773  0.0875

endswith slice
 0.0875  0.0767
 0.0871  0.0860
 0.0875  0.0775
 0.0877  0.1090
 0.0954  0.0780


Using [-len(x):]
----plain old test ---

slice endswith
 0.0573  0.0271
 0.0566  0.0268
 0.0565  0.0270
 0.0586  0.0270
 0.0632  0.0269

endswith slice
 0.0271  0.0568
 0.0271  0.0567
 0.0270  0.0563
 0.0270  0.0566
 0.0271  0.0567
---- aspect test ---

slice endswith
 0.1244  0.0871
 0.1240  0.0891
 0.1312  0.0873
 0.1241  0.0875
 0.1312  0.0877

endswith slice
 0.0875  0.1241
 0.0891  0.1305
 0.0876  0.1241
 0.0874  0.1241
 0.0938  0.1243



More information about the Python-list mailing list