Results 1 to 4 of 4

Thread: Loading Speed

  1. #1

    Thread Starter
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Loading Speed

    There are dozens of list programs for PDA's available for free. Of course, if you get one of those, you are tied to someone else's interpretation of the problem. Therefore, I decided to write my own shopping list program so that I would stop ending up at the store standing there thinking, "Now, what was it I came here for?" Heck, I'm not even all that old!

    The program works great, and has all the features I wanted: Categorical items, items not tied to specific categories, easy handling of (optional) number of units, etc.

    Great!


    Slow loading!


    One freebie I downloaded came up very fast. Of couse, it was much simpler, and kept everything in two text files. I am using a database saved on an SD card. It takes 6 seconds for the program to load up. Most of that is establishing the DB connection, and reading in data.

    Does anybody have any thoughts on how to speed up the reaction time of the program? I even considered storing an image of the initial screen, and tossing that up first. Using that technique, the user would see the controls appear to lag (since they would only be an image, not the real thing) for a few seconds, but that seems just a little hokey.
    My usual boring signature: Nothing

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Loading Speed

    I've done a little work with eVB, and found that accessing files anywhere other than the main file store is very slow.

    I couldn't find a way to speed it up, so I stored the files in main memory and just backed them up to the other area (restoring the 'backup' if it is a more recent version). Perhaps the same method would work here?

  3. #3

    Thread Starter
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Loading Speed

    Excellent, I'll give it a try.

    I do want to keep the DB on the SD card so that it isn't erased when I forget to charge the battery for a few weeks, but I could simply copy it from one place to the other and back.
    My usual boring signature: Nothing

  4. #4

    Thread Starter
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Loading Speed

    Didn't work. Moving the DB to the local folder left loading speed unchanged. Tested it several times. Fortunately, I did learn some things I didn't know about how DB manipulations work on a PDA.

    In the end, I decided to cheat, on the principle that appearance is everything.

    All of my PDA programs generally have one form with multiple panels. I only add a second form if there are too many panels to manage on a single form. Instead of swapping forms, I swap panels into the view pane, which is almost instantaneous.

    To cheat in this case, I made a splash form with a single panel that is swapped into the view pane during load (which happens before almost anything else). The panel looks almost identical to the start panel on the main form, but, since it is non-modal, there are a few cosmetic differences.

    The start panel on the main form is a multi-select ListBox (actually, a cheat, since multi-select listboxes don't exist in the CF), and a button. This is the current shopping list. When the program exits, the items in the shopping list are saved to a text file (fast reading and writing). When the program starts, labels on the splash form are loaded with the strings from the text file. By doing this, the current list is visible to the user while the main form loads. Once the main form is ready, the splash form is closed. Since the panels look similar, there is little change (except the menu appears and the button appears), but the user has the current list without waiting for all the loading and connecting to complete.

    The time to see the current list is now about 2.2 seconds, while the full program is up and running in about 6.5 seconds. This has a good 'feel' to it.

    Any other suggestions for speeding things up would be considered.
    My usual boring signature: Nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width