Print Page | Close Window

[DISCUSSION] Adding records...

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=11586
Printed Date: 02 May 2024 at 10:08pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [DISCUSSION] Adding records...
Posted By: Aaron
Subject: [DISCUSSION] Adding records...
Date 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:
 
https://forum.codejock.com/uploads/20080726_033101_AddRecords.zip - uploads/20080726_033101_AddRecords.zip
 
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....



Replies:
Posted By: AndreiM
Date 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.
    http://forum.codejock.com/uploads/20080726_141810_AddRecordsEx_pe.zip - 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).


-------------
Regards,
Andrei Melnik


Posted By: Aaron
Date 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....


Posted By: AndreiM
Date Posted: 28 July 2008 at 11:12am
Will be fixed in 12.0.2 (with fix for UpdateRecord)


-------------
Regards,
Andrei Melnik



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net