Speed of the compiled application?

Discussion in 'Questions (Windows Mobile)' started by JamesC, Mar 10, 2008.

  1. JamesC

    JamesC Member Licensed User


    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:
  2. Erel

    Erel Administrator Staff Member Licensed User

    On average, compiled applications run about 3-4 times faster.
    However it can change between different programs.
    What are you doing with each line?
  3. JamesC

    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!?
  4. Erel

    Erel Administrator Staff Member Licensed User

    Using an SQL database will be much faster (you will be able to load the right lines immediately).
  5. JamesC

    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: Mar 10, 2008
  6. Leginus

    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.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice