One way to increase performance

Find out how to get things done with Servoy. Post how YOU get things done with Servoy

One way to increase performance

Postby idoctor » Sun May 02, 2004 9:55 am

I have a solution with many columns/fields in a row. I often need to use a method to either clear or assign values to 50 or more columns/fields. Until recently this was painfully slow. However, recently I noticed that when I clear the fields by assigning them the null value instead of the '' value it markedly increases the rate at which the fields are cleared. I also noted that if I need to assign values to the columns/fields it is much faster to assign a value to a field that formerly was assigned null than a field that was formerly assigned ''. In my solution this makes a huge difference speeding things up about an order of magnitude. I now go out of my way to use null instead of '' whenever possible.

John McCann

Servoy Client
Version R2 2.0-build 273
Java version 1.4.2_04-b05 (Windows XP)
idoctor
 
Posts: 254
Joined: Sun Sep 28, 2003 6:37 pm

Postby Harjo » Sun May 02, 2004 10:05 am

Have you ever tried the getFoundSetUpdater?
This is much quicker!!!

Here is an example, which you can find in the method-editor too:
Code: Select all
//1) update entire foundset
var fsUpdater = databaseManager.getFoundSetUpdater(foundset)
fsUpdater.setColumn('field1',null)
fsUpdater.setColumn('field2',"hello")
fsUpdater.performUpdate()


Hope this helps
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby idoctor » Mon May 03, 2004 10:14 am

I tried this and your method is much faster. I notedwhat might be a bug in the foundsetupdater and reported it.

Thanks for sharing your idea

John McCann
idoctor
 
Posts: 254
Joined: Sun Sep 28, 2003 6:37 pm


Return to How To

Who is online

Users browsing this forum: No registered users and 6 guests

cron