[DISCUSSION] Adding records... |
Post Reply |
Author | |
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
Posted: 26 July 2008 at 3:31am |
Hi,
In my post FIXED BUGS: ... Andrei mentioned that adding records with AddRecordsEx should be faster than AddRecords + Populate. I created a test project for this just to test which of the methods is faster and it seems that AddRecords + Populate is faster. I already said to Andrei that I surely made a mistake somewhere so that's why I created a test. Is there a better, faster, easier or whatever you can think of, I'm in to all ideas. Me like fast loading yes yes yes So here it is:
Thanks a lot
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
AndreiM
Moderator Group Joined: 18 August 2007 Status: Offline Points: 132 |
Post Options
Thanks(0)
|
Hi,
I am talking about adding one or few (2,3 .. 20..) records to the existing big records set. For example on the loading you fill report control using AddRecord + Populate. Than if you need add few records later, on runtime, you may use AddRecordEx which is faster in this case than AddRecord + repopulate all records again. AddRecord just add record object to collection.
Populate delete all raws, loop for records collection and create row for each record, sort rows if need and group rows if need. AddRecordEx add record object to collection, create row for new record only, find place in rows collection to insert new row, create group rows if need.
Some of our customers have 'slow' and big data sources. They do not load all records at one time (because this takes long time).
They create a working thread (or by timer) which load record part by part and add them one by one at runtime using AddRecordEx. -------------------------------------------------------------
I have changed your sample to show performance difference. uploads/20080726_141810_AddRecordsEx_pe.zip
On my computer AddRecordEx about 10 times faster then AddRecord + Populate when adding single record to existing records set. Also, as I see your performance counter has not right calculation: if you click many times for one selected method - you can see very different results sometimes. I made more simple calculation in performance ticks by .Lo part only (Hi parts are the same).
|
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi Andrei,
Thanks for clearing that up. If you look at it that way, you are right that AddRecordEx method is faster. My test shows when adding records with AddRecordEx it takes longer to load, lets say 10.000 records, than with AddRecord.
QUESTION:
If you add a record with AddRecordEx, it will be added on the first row (if no .Populate call has been made) Is it possible to add it at the end?
Thanks
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
AndreiM
Moderator Group Joined: 18 August 2007 Status: Offline Points: 132 |
Post Options
Thanks(0)
|
Will be fixed in 12.0.2 (with fix for UpdateRecord) |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |