Speed of the compiled application?

JamesC

Member
Licensed User
Hi

At the moment I'm using the basic4ppc trial - and I must say I like the way it is working for my simple database app :) especially developing on the ppc.

My question is how much faster will the compiled app be - or does it depend on what the app does? The operation that takes longest in my app is looping through Fileread lines from a large file - will that be much faster in the compiled app?

Thx :sign0098:
 

JamesC

Member
Licensed User
Wow - that was a quick reply - you must live on this forum !! ;)

What am I doing with each line?

I have a text file of several thousand lines, and I want to loop through until I reach a certain line, say, line 1400, and then add lines 1401 to 1430 to a string. So I guess the quickest way to get to line 1400 is to fileread 1400 times!?
 

JamesC

Member
Licensed User
Thanks Erel. I'll look into that.

Actually, I forgot to say that some of the time I'm checking each line for a certain chr, and if it exists (as it does about 1/3rd of the time), then I'm taking a substring of the line and adding it to a table. But I would expect that to be a lot slower than just Filereading a line. I thought the simple Filereads to loop to a certain line might be much faster when compiled.

Anyway, no worries! :)
 
Last edited:

Leginus

Member
Licensed User
If you are checking for a certain chr then the quick way if you don't wish to use sql is read the whole file into a variable and search from there. You can use a text box for this but a variable is definitely quicker as I have tested this in one of my programs. If the file is too big for memory then you can read it in chunks.
e.g. read from pos 0 to 1000 and 1001 to 2000 and so on.

You can then get the char position within the variable and manipulate the string as you were doing. It is file access that is slowing this down.
 
Top