Question: Time analysis on the replace(), translate(), and regular expression methods of removing punctuation from randomly generated strings using the timing framework from Chapter 10. Average

Time analysis on the replace(), translate(), and regular expression methods of removing punctuation from randomly generated strings using the timing framework from Chapter 10. Average Run-Time of testRegEx(30) is 3.120041e-06 seconds. Average Run-Time of testRegEx(280) is 2.340007e-05 seconds. Average Run-Time of testRegEx(530) is 1.872003e-05 seconds. Average Run-Time of testTranslate(30) is 1.559997e-06 seconds. Average Run-Time of testTranslate(280) is 6.240058e-06 seconds. Average Run-Time of testTranslate(530) is 1.560001e-05 seconds. Average Run-Time of testReplace(30) is 4.680014e-06 seconds. Average Run-Time of testReplace(280) is 1.092002e-05 seconds. Average Run-Time of testReplace(530) is 1.872005e-05 seconds. timeit.Timer() was used for greater accuracy. the translate function was the most efficient based on time run analysis. Time analysis on the replace(), translate(), and regular expression methods of removing punctuation from randomly generated strings using timeit.Timer() The average time from on 1,000,000 runs for each input, and each function, is reported. Testing s = oK~u}JAHCLP0^Z"qhneTZXVR7A{ELD`jr]:;3!f(]vha\C9f&_{&j,5%H32Dzr%nZS1um.P-hR0.z!?TEb8.%#Z?km8f1lGX6[|2eL[2NbCUHl*n1EC~^.Js6s#V-d&mjz$:Wt~{^(J=/4ki4|%uQuaLd!uYe regEx : 1.4057603399999863e-05 translate : 4.357549200000221e-06 replace : 9.560869499999924e-06 Testing s = _]bh}`=__@{v6lYR/Ea2!oQ(!\_A6pfE3v39jJh\Au;FMp%%#U|fA\>li%~rOTf3|CDP~cH!$P;2HctA%b{S,,E7/V#uPebbEXu{Vj-lFS]d"="IuC}dRpd/~Gjn&$!YLiBw//ofjsivWLHG),"dTNGo8-cp$j.1|u*.GKiIp6C4Ad3:(@1jt>ii\TM5u\,Z0qX$g$PH[Q9JM-c5>!4&Y{9UV7v0x:TF>W-2i.`a"h?DGCn&12G4%&jLp^Mn5`],iFnk+!DYops"D

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!