Re: How fast is Euphoria's string processing?
- Posted by Derek Parnell <ddparnell at bigpond?com> Nov 07, 2007
- 541 views
Kai wrote: > > Hi all ~ > > I was wondering if one > could whip up the equivalent in Euphoria for comparison purposes? -- start of program -- sequence str sequence finale atom st,et puts(1,"START...\n") st = time() -- Initialize the result to an empty string finale = "" -- repeat for 10,000 times for i=1 to 10000 do -- Initialize the temporary string str = "" -- repeat for 500 times for j = 1 to 500 do -- append the string repesentations of i and j str &= sprintf("%d,%d-", {i,j}) end for -- Append the first five characters of the temp str to the result finale &= str[1..5] end for et = time() puts(1, "COMPLETED!!!\n") printf(1, "%s\n%d\n%f seconds\n", {finale, length(finale), et-st}) -- end of program -- -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell