Speeding things up

jda jda at his.com
Sun Jun 25 09:46:32 CDT 2006


Hi Ruslan,

I'm trying to improve the launch time of my app, and in the course of 
this found one point I hope can be optimized.

When I open a Valentina db I check to see the schema version so that 
I can update one of the tables if necessary (otherwise of course I 
get an exception if the class definitions don't match). I'm finding 
that simply opening a VDatabase to check the schemaversion takes 
about half a second (30 ticks) on my Intel Mac! Here's the code:

     vdb = new VDatabase
     vdb.open(f)
      if vdb <> nil then
       if vdb.SchemaVersion < 904 then
           //add new field to table
       end if
       vdb.close
       vdb =  nil
     end if

Is there a faster way to check for schema version and compatibility?

Thanks,

Jon


More information about the Valentina-beta mailing list