Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. c:\ron\mit\classes\6.006\Spring 2007\timing>timing.py timing.py Test Misc-1 -- running time should be n+2*m+7+3*n*lg(n)+17*n*m Spec_string: 1<=n<=100000;1<=m<=100000 by factors of 10 var_list ['n', 'm'] Function list: ('(n*m)', 'n**2', 'n*lg(n)', 'n', 'm', '1') run times: n = 1 m = 1 : 27.000000 microseconds n = 1 m = 10 : 198.000000 microseconds n = 1 m = 100 : 1908.000000 microseconds n = 1 m = 1000 : 19008.000000 microseconds n = 1 m = 10000 : 190008.000000 microseconds n = 1 m = 100000 : 1900008.000000 microseconds n = 10 m = 1 : 288.657843 microseconds n = 10 m = 10 : 1836.657843 microseconds n = 10 m = 100 : 17316.657843 microseconds n = 10 m = 1000 : 172116.657843 microseconds n = 10 m = 10000 : 1720116.657843 microseconds n = 10 m = 100000 : 17200116.657843 microseconds n = 100 m = 1 : 3802.156857 microseconds n = 100 m = 10 : 19120.156857 microseconds n = 100 m = 100 : 172300.156857 microseconds n = 100 m = 1000 : 1704100.156857 microseconds n = 100 m = 10000 : 17022100.156857 microseconds n = 100 m = 100000 : 170202100.156857 microseconds n = 1000 m = 1 : 47906.352854 microseconds n = 1000 m = 10 : 200924.352854 microseconds n = 1000 m = 100 : 1731104.352854 microseconds n = 1000 m = 1000 : 17032904.352854 microseconds n = 1000 m = 10000 : 170050904.352854 microseconds n = 1000 m = 100000 : 1700230904.352854 microseconds n = 10000 m = 1 : 578640.371386 microseconds n = 10000 m = 10 : 2108658.371386 microseconds n = 10000 m = 100 : 17408838.371386 microseconds n = 10000 m = 1000 : 170410638.371387 microseconds n = 10000 m = 10000 : 1700428638.371387 microseconds n = 10000 m = 100000 : 17000608638.371386 microseconds n = 100000 m = 1 : 6782901.142331 microseconds n = 100000 m = 10 : 22082919.142331 microseconds n = 100000 m = 100 : 175083099.142331 microseconds n = 100000 m = 1000 : 1705084899.142331 microseconds n = 100000 m = 10000 : 17005102899.142330 microseconds n = 100000 m = 100000 : 170005282899.142330 microseconds Coefficients as interpolated from data: 17*(n*m) -4.36072e-012*n**2 +3*n*lg(n) +1*n +2*m +7*1 (measuring time in microseconds) Sum of squares of residuals: 2.01144964616e-017 RMS error = 7.5e-008 percent Test Misc-2: pass Spec_string: 10000<=n<=1000000 by factors of 2 var_list ['n'] Function list: ('1',) run times: n = 10000 : 0.035479 microseconds n = 20000 : 0.035200 microseconds n = 40000 : 0.035200 microseconds n = 80000 : 0.035200 microseconds n = 160000 : 0.035200 microseconds n = 320000 : 0.035200 microseconds n = 640000 : 0.035479 microseconds Coefficients as interpolated from data: 0.0352789*1 (measuring time in microseconds) Sum of squares of residuals: 8.89703461836e-005 RMS error = 0.36 percent Test Number-1 -- time to compute int('1'*n) Spec_string: 1000<=n<=10000 by factors of 2 var_list ['n'] Function list: ('n**2',) run times: n = 1000 : 103.611493 microseconds n = 2000 : 353.647461 microseconds n = 4000 : 1346.279765 microseconds n = 8000 : 5402.854553 microseconds Coefficients as interpolated from data: 8.89145e-005*n**2 (measuring time in microseconds) Sum of squares of residuals: 0.0262043488506 RMS error = 8.1 percent Test Number-2 -- time to compute repr(2**n) Spec_string: 1000<=n<=10000 by factors of 2 var_list ['n'] Function list: ('n**2',) run times: n = 1000 : 85.623173 microseconds n = 2000 : 323.066479 microseconds n = 4000 : 1195.658387 microseconds n = 8000 : 4776.919692 microseconds Coefficients as interpolated from data: 7.8424e-005*n**2 (measuring time in microseconds) Sum of squares of residuals: 0.0129270585061 RMS error = 5.7 percent Test Number-3 -- time to convert (2**n) to hex Spec_string: 1000<=n<=100000 by factors of 2 var_list ['n'] Function list: ('n',) run times: n = 1000 : 3.610794 microseconds n = 2000 : 6.138769 microseconds n = 4000 : 10.503011 microseconds n = 8000 : 20.104510 microseconds n = 16000 : 42.613796 microseconds n = 32000 : 78.768950 microseconds n = 64000 : 157.035322 microseconds Coefficients as interpolated from data: 0.00268253*n (measuring time in microseconds) Sum of squares of residuals: 0.10380215475 RMS error = 12 percent Test Number-4 -- time to add 2**n to itself Spec_string: 1000<=n<=1000000 by factors of 2 var_list ['n'] Function list: ('n',) run times: n = 1000 : 0.900925 microseconds n = 2000 : 1.724325 microseconds n = 4000 : 3.490136 microseconds n = 8000 : 6.099937 microseconds n = 16000 : 11.359516 microseconds n = 32000 : 23.561458 microseconds n = 64000 : 50.156291 microseconds n = 128000 : 91.129487 microseconds n = 256000 : 180.313783 microseconds n = 512000 : 369.967133 microseconds Coefficients as interpolated from data: 0.000764723*n (measuring time in microseconds) Sum of squares of residuals: 0.0751691919183 RMS error = 8.7 percent Test Number-5 -- time to multiply (2**n/3) by itself Spec_string: 1000<=n<=100000 by factors of 2 var_list ['n'] Function list: ('n**1.585',) run times: n = 1000 : 9.603735 microseconds n = 2000 : 37.903141 microseconds n = 4000 : 128.079965 microseconds n = 8000 : 411.606503 microseconds n = 16000 : 1261.329024 microseconds n = 32000 : 4037.848944 microseconds n = 64000 : 11384.439642 microseconds Coefficients as interpolated from data: 0.000233608*n**1.585 (measuring time in microseconds) Sum of squares of residuals: 0.254458390439 RMS error = 19 percent Test Number-6 -- time to divide (2**(2n) by (2**n)) Spec_string: 1000<=n<=50000 by factors of 2 var_list ['n'] Function list: ('n**2',) run times: n = 1000 : 50.918762 microseconds n = 2000 : 185.058995 microseconds n = 4000 : 706.360445 microseconds n = 8000 : 2765.383031 microseconds n = 16000 : 11324.600473 microseconds n = 32000 : 44011.178795 microseconds Coefficients as interpolated from data: 4.49978e-005*n**2 (measuring time in microseconds) Sum of squares of residuals: 0.0188569527928 RMS error = 5.6 percent Test Number-7 -- time to compute remainder of (2**(2n) by (2**n)) Spec_string: 1000<=n<=50000 by factors of 2 var_list ['n'] Function list: ('n**2',) run times: n = 1000 : 50.537987 microseconds n = 2000 : 185.482233 microseconds n = 4000 : 702.703556 microseconds n = 8000 : 2765.272681 microseconds n = 16000 : 11614.697119 microseconds n = 32000 : 46307.518972 microseconds Coefficients as interpolated from data: 4.55453e-005*n**2 (measuring time in microseconds) Sum of squares of residuals: 0.0144413821636 RMS error = 4.9 percent Test Number-8 -- time to compute pow(x,y,z) Spec_string: 1000<=n<=5000 by factors of 2 var_list ['n'] Function list: ('n**3',) run times: n = 1000 : 67977.689902 microseconds n = 2000 : 455712.611519 microseconds n = 4000 : 3418937.546532 microseconds Coefficients as interpolated from data: 5.8269e-005*n**3 (measuring time in microseconds) Sum of squares of residuals: 0.0291588961507 RMS error = 9.9 percent Test Number-9 -- time to compute 2**n Spec_string: 1000<=n<=1000000 by factors of 2 var_list ['n'] Function list: ('1',) run times: n = 1000 : 0.060538 microseconds n = 2000 : 0.054504 microseconds n = 4000 : 0.055035 microseconds n = 8000 : 0.059030 microseconds n = 16000 : 0.054532 microseconds n = 32000 : 0.054504 microseconds n = 64000 : 0.071434 microseconds n = 128000 : 0.054672 microseconds n = 256000 : 0.054504 microseconds n = 512000 : 0.054532 microseconds Coefficients as interpolated from data: 0.0566032*1 (measuring time in microseconds) Sum of squares of residuals: 0.0584126031316 RMS error = 7.6 percent Test String-1: extract a byte from a string Spec_string: 1000<=n<=1000000 by factors of 2 var_list ['n'] Function list: ('1',) run times: n = 1000 : 0.120965 microseconds n = 2000 : 0.120406 microseconds n = 4000 : 0.120406 microseconds n = 8000 : 0.120406 microseconds n = 16000 : 0.120686 microseconds n = 32000 : 0.120406 microseconds n = 64000 : 0.120406 microseconds n = 128000 : 0.120406 microseconds n = 256000 : 0.120406 microseconds n = 512000 : 0.120965 microseconds Coefficients as interpolated from data: 0.120545*1 (measuring time in microseconds) Sum of squares of residuals: 3.47612223577e-005 RMS error = 0.19 percent Test String-2: concatenate two string of length n Spec_string: 1000<=n<=500000 by factors of 2 var_list ['n'] Function list: ('n',) run times: n = 1000 : 1.455772 microseconds n = 2000 : 2.320407 microseconds n = 4000 : 3.960280 microseconds n = 8000 : 10.975138 microseconds n = 16000 : 14.755507 microseconds n = 32000 : 28.607267 microseconds n = 64000 : 62.158738 microseconds n = 128000 : 111.005170 microseconds n = 256000 : 250.531841 microseconds Coefficients as interpolated from data: 0.00100789*n (measuring time in microseconds) Sum of squares of residuals: 0.236104601731 RMS error = 16 percent Test String-3: extract a string of length n/2 Spec_string: 1000<=n<=500000 by factors of 2 var_list ['n'] Function list: ('n',) run times: n = 1000 : 0.665448 microseconds n = 2000 : 1.061587 microseconds n = 4000 : 1.499911 microseconds n = 8000 : 2.376559 microseconds n = 16000 : 5.032483 microseconds n = 32000 : 7.567722 microseconds n = 64000 : 15.082084 microseconds n = 128000 : 33.720487 microseconds n = 256000 : 58.575322 microseconds Coefficients as interpolated from data: 0.00028179*n (measuring time in microseconds) Sum of squares of residuals: 0.761186207796 RMS error = 29 percent Test String-4: translate a string of length n Spec_string: 1000<=n<=500000 by factors of 2 var_list ['n'] Function list: ('n',) run times: n = 1000 : 4.039340 microseconds n = 2000 : 7.428318 microseconds n = 4000 : 18.500955 microseconds n = 8000 : 24.346949 microseconds n = 16000 : 51.699029 microseconds n = 32000 : 92.001358 microseconds n = 64000 : 181.911668 microseconds n = 128000 : 364.994992 microseconds n = 256000 : 721.273514 microseconds Coefficients as interpolated from data: 0.00316217*n (measuring time in microseconds) Sum of squares of residuals: 0.220752805449 RMS error = 16 percent Test List-1: create an empty list Spec_string: 1<=n<=10 by factors of 2 var_list ['n'] Function list: ('1',) run times: n = 1 : 0.398375 microseconds n = 2 : 0.397257 microseconds n = 4 : 0.398375 microseconds n = 8 : 0.396978 microseconds Coefficients as interpolated from data: 0.397744*1 (measuring time in microseconds) Sum of squares of residuals: 1.02387998751e-005 RMS error = 0.16 percent Test List-2: list (array) lookup Spec_string: 10000<=n<=1000000 by factors of 2 var_list ['n'] Function list: ('1',) run times: n = 10000 : 3.269131 microseconds n = 20000 : 0.093867 microseconds n = 40000 : 0.093587 microseconds n = 80000 : 0.093587 microseconds n = 160000 : 0.093867 microseconds n = 320000 : 0.099175 microseconds n = 640000 : 0.101689 microseconds Coefficients as interpolated from data: 0.096206*1 (measuring time in microseconds) Sum of squares of residuals: 0.948620078237 RMS error = 37 percent Test List-3: appending to a list of length n Spec_string: 10000<=n<=1000000 by factors of 2 var_list ['n'] Function list: 1 run times: n = 10000 : 0.230476 microseconds n = 20000 : 0.233549 microseconds n = 40000 : 0.233270 microseconds n = 80000 : 0.234108 microseconds n = 160000 : 0.291937 microseconds n = 320000 : 0.248076 microseconds n = 640000 : 0.239137 microseconds Coefficients as interpolated from data: 0.24165*1 (measuring time in microseconds) Sum of squares of residuals: 0.0363340907774 RMS error = 7.2 percent Test List-4: Pop Spec_string: 1000<=n<=100000 by factors of 2 var_list ['n'] Function list: ('1',) run times: n = 1000 : 0.250032 microseconds n = 2000 : 0.252825 microseconds n = 4000 : 0.248635 microseconds n = 8000 : 0.474921 microseconds n = 16000 : 0.248635 microseconds n = 32000 : 0.248635 microseconds n = 64000 : 0.248635 microseconds Coefficients as interpolated from data: 0.259462*1 (measuring time in microseconds) Sum of squares of residuals: 0.215515737309 RMS error = 18 percent Test List-5: concatenating two lists of length n Spec_string: 1000<=n<=100000 by factors of 2 var_list ['n'] Function list: ('n',) run times: n = 1000 : 22.556917 microseconds n = 2000 : 42.226037 microseconds n = 4000 : 84.081915 microseconds n = 8000 : 192.121066 microseconds n = 16000 : 341.527485 microseconds n = 32000 : 664.830446 microseconds n = 64000 : 1382.123985 microseconds Coefficients as interpolated from data: 0.0216799*n (measuring time in microseconds) Sum of squares of residuals: 0.0148260625595 RMS error = 4.6 percent Test List-6: extracting a slice of length n/2 Spec_string: 1000<=n<=100000 by factors of 2 var_list ['n'] Function list: ('n',) run times: n = 1000 : 5.430858 microseconds n = 2000 : 11.408154 microseconds n = 4000 : 21.698987 microseconds n = 8000 : 46.418749 microseconds n = 16000 : 85.098665 microseconds n = 32000 : 167.969113 microseconds n = 64000 : 341.065694 microseconds Coefficients as interpolated from data: 0.00545245*n (measuring time in microseconds) Sum of squares of residuals: 0.00829402546675 RMS error = 3.4 percent Test List-7: copy Spec_string: 1000<=n<=100000 by factors of 2 var_list ['n'] Function list: ('n',) run times: n = 1000 : 10.879874 microseconds n = 2000 : 22.223216 microseconds n = 4000 : 41.329275 microseconds n = 8000 : 83.549026 microseconds n = 16000 : 167.703158 microseconds n = 32000 : 342.658913 microseconds n = 64000 : 691.628405 microseconds Coefficients as interpolated from data: 0.0106683*n (measuring time in microseconds) Sum of squares of residuals: 0.00398564667544 RMS error = 2.4 percent Test List-8: assigning a slice of length n/2 Spec_string: 1000<=n<=100000 by factors of 2 var_list ['n'] Function list: ('n',) run times: n = 1000 : 12.181297 microseconds n = 2000 : 23.218454 microseconds n = 4000 : 41.731840 microseconds n = 8000 : 95.302476 microseconds n = 16000 : 183.167134 microseconds n = 32000 : 352.995981 microseconds n = 64000 : 703.976902 microseconds Coefficients as interpolated from data: 0.0113188*n (measuring time in microseconds) Sum of squares of residuals: 0.0169841182606 RMS error = 4.9 percent Test List-9: Delete first Spec_string: 1000<=n<=100000 by factors of 2 var_list ['n'] Function list: ('n',) run times: n = 1000 : 1.965334 microseconds n = 2000 : 3.279746 microseconds n = 4000 : 6.722921 microseconds n = 8000 : 15.603938 microseconds n = 16000 : 26.222607 microseconds n = 32000 : 56.135626 microseconds n = 64000 : 116.530174 microseconds Coefficients as interpolated from data: 0.00176084*n (measuring time in microseconds) Sum of squares of residuals: 0.0346266192167 RMS error = 7 percent Test List-10: Reverse Spec_string: 1000<=n<=100000 by factors of 2 var_list ['n'] Function list: ('n',) run times: n = 1000 : 1.300445 microseconds n = 2000 : 2.367619 microseconds n = 4000 : 4.521524 microseconds n = 8000 : 9.044446 microseconds n = 16000 : 18.734225 microseconds n = 32000 : 69.015755 microseconds n = 64000 : 77.318486 microseconds Coefficients as interpolated from data: 0.00122868*n (measuring time in microseconds) Sum of squares of residuals: 0.207467955509 RMS error = 17 percent Test List-11: Sort Spec_string: 1000<=n<=100000 by factors of 2 var_list ['n'] Function list: ('n*lg(n)',) run times: n = 1000 : 48.536895 microseconds n = 2000 : 90.653980 microseconds n = 4000 : 212.818948 microseconds n = 8000 : 396.117384 microseconds n = 16000 : 786.993878 microseconds n = 32000 : 1695.112088 microseconds n = 64000 : 3443.744945 microseconds Coefficients as interpolated from data: 0.00383757*n*lg(n) (measuring time in microseconds) Sum of squares of residuals: 0.103211953024 RMS error = 12 percent Test Dict-1: create an empty dictionary Spec_string: 1<=n<=1 by factors of 2 var_list ['n'] Function list: ('1',) run times: n = 1 : 0.354235 microseconds Coefficients as interpolated from data: 0.354235*1 (measuring time in microseconds) Sum of squares of residuals: 0.0 RMS error = 0 percent Test Dict-2: dictionary lookup Spec_string: 1000<=n<=100000 by factors of 2 var_list ['n'] Function list: ('1',) run times: n = 1000 : 0.113702 microseconds n = 2000 : 0.114819 microseconds n = 4000 : 0.113702 microseconds n = 8000 : 0.114819 microseconds n = 16000 : 0.117892 microseconds n = 32000 : 0.121803 microseconds n = 64000 : 0.121524 microseconds Coefficients as interpolated from data: 0.116714*1 (measuring time in microseconds) Sum of squares of residuals: 0.00536071425992 RMS error = 2.8 percent Test Dict-3: dictionary copy Spec_string: 1000<=n<=100000 by factors of 2 var_list ['n'] Function list: ('n',) run times: n = 1000 : 51.503753 microseconds n = 2000 : 111.870922 microseconds n = 4000 : 186.039008 microseconds n = 8000 : 435.759014 microseconds n = 16000 : 777.675375 microseconds n = 32000 : 3505.858706 microseconds n = 64000 : 6638.197872 microseconds Coefficients as interpolated from data: 0.0555939*n (measuring time in microseconds) Sum of squares of residuals: 0.523518640703 RMS error = 27 percent Test Dict-4: dictionary list items Spec_string: 1000<=n<=100000 by factors of 2 var_list ['n'] Function list: ('n*lg(n)',) run times: n = 1000 : 100.440978 microseconds n = 2000 : 185.999059 microseconds n = 4000 : 440.980069 microseconds n = 8000 : 966.602739 microseconds n = 16000 : 2007.476928 microseconds n = 32000 : 5443.849148 microseconds n = 64000 : 13059.486052 microseconds Coefficients as interpolated from data: 0.0096938*n*lg(n) (measuring time in microseconds) Sum of squares of residuals: 0.112504731283 RMS error = 13 percent c:\ron\mit\classes\6.006\Spring 2007\timing>