upper()

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

data = repeat({rand(24)+97},1000000)
upperdata = repeat({rand(24)+97},1000000)

puts(1,"repeats done, press a key\n")
junk = wait_key()

  --for loop = 1 to length(data) do upperdata[loop] = upper(data[loop]) end for
  for loop = 1 to length(data) do upperdata[loop] = data[loop] end for


The commented out line uses 48megabytes of memory, and takes 170 
seconds to run.

The next line is the same, but without upper(), and executes instantly.

This line takes all night to run:
upperdata = upper(data)

Why, and how can i avoid the penalty of upper(), and still get the upperdata? 
Yes, i need both data and upperdata.

Incidently, OOEU runs the commented out line in 4 seconds, but takes all 
night to run parse() or gets(). Using define_c_proc(open_dll("msvcrt.dll"), 
"_strupr", {C_POINTER}) doesn't help in OOEU, but does in exw.exe. It's 
very frustrating.

The actual data (not the test set above) is a million ~30-character lines in a 
24megabyte file. I cannot run the app every 30 minutes anymore. Either 
parse(), gets(), or upper() take too long.

Kat

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

Search



Quick Links

User menu

Not signed in.

Misc Menu