Re: Eu Interpreted

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Tuesday 14 August 2001 20:57, Derek Parnell wrote:
>
> Hi Jiri and Ross,
> I'm sorry. I must have misunderstood Irv's purpose. I thought the code was
> trying to time the upper() function, not the whole exercise of reading and
> processing the data as well. If that were the case, I'd not have used
> append() nor concatenation, but rather I'd have used get_bytes() to read in
> the entire file in one go.

Hi Derek:
I moved the start time after the dir() command in your program, so as 
not to include that in the total. I didn't need to do a dir() in Lua, in 
order to read the entire file, and I haven't found Lua's equivalent yet, 
anyway.

Euphoria: Filesize=390768 Seconds=0.220000 in=0.110000 out=0.022000  
Lua: Seconds=0.050000 in=0.010000 out=0.008000
Subsequent runs of Lua are about 20% faster.
Subsequent runs of Eu are the same.

Regards,
Irv
-------------------------------------
-- Lua version
-------------------------------------
FileOutNames = {"test1.txt", "test2.txt", "test3.txt",
                         "test4.txt", "test5.txt"}

FileName = "lua.txt" 

start = clock()
readfrom(FileName)
textdata = read("*all")
readfrom() 

chkpt = clock()

for i = 1, 5 do
    writeto(FileOutNames[i])
    write(textdata)
    writeto()
end
stop = clock()

print(format("Seconds=%f in=%f out=%f\n",
      stop - start,  chkpt - start,  (stop - chkpt)/5) )

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu