Speeding up UpdateRecord

Beatrix Willius bwillius at gmx.de
Sat Jan 11 11:10:00 CST 2014


The change is different for each record. No, the changes can’t be formulated in SQL.

The test database is 350 MB.  Cleaning took about 2 minutes. There are a couple of things done here like removing white spaces etc. Literally over 80% of all calculations were spent in UpdateRecord according to Instruments.

I don’t see any speed loss in getting the data via SetString. Possible gains with accessing via index can only be very small. 

Begin forwarded message:

> From: Jay Madren <jay at jaymadren.com>
> 
> Well, updating a large text field across thousands of records is never going to be instantaneous. How slow is too slow? (how long is it taking per 100 or per 1000 records?)
> 
> What are you updating the message text with? Is it constant, or variable depending on the message itself? If the changes can be formulated in SQL only, then it could be faster. But I assume you're not using a vserver, so the speed increase may be marginal.
> 
Begin forwarded message:

> From: Steve Albin <steve at steve-albin.com>
> 
> Isn't it faster to use a numeric index of the field rather than the name of the field as well as avoiding the casting of the field type?
> 
> Instead of:
> theCursor.Field("MessageBody").SetString theCleaner.execute
> 
> shouldn't it be 
> theCursor.varcharfield(1).value theCleaner.execute
> 
> Assuming the field is VarChar and in the first position of the cursor.  Not sure this would make a significant difference, but I think it is faster, no?
> 

Mit freundlichen Grüßen/Regards

Trixi Willius

http://www.mothsoftware.com
Mail Archiver X: The email archiving solution for professionals

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macserve.net/pipermail/valentina/attachments/20140111/95471333/attachment-0001.html>


More information about the Valentina mailing list