Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - [DISCUSSION] Adding records...
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[DISCUSSION] Adding records...

 Post Reply Post Reply
Author
Message
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Topic: [DISCUSSION] Adding records...
    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....
Back to Top
AndreiM View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 18 August 2007
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreiM Quote  Post ReplyReply Direct Link To This Post Posted: 26 July 2008 at 2:19pm
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).
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 27 July 2008 at 2:16am
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....
Back to Top
AndreiM View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 18 August 2007
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreiM Quote  Post ReplyReply Direct Link To This Post Posted: 28 July 2008 at 11:12am
Will be fixed in 12.0.2 (with fix for UpdateRecord)
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.266 seconds.