cfront performance

PoweRoyPoweRoy Member Posts: 43
edited 2006-04-04 in Navision Attain
ive made a program wich reads all the records out of a table. I used a small database (chronus) to test. Now i am trying to open the company database (6gig) and it takes +-2min to read 80000 records. (2min 100%cpu, not much HD activity)
the program is written in C# and the ocx.
in pseudo-code:
while not end of table
{
next record
while not end of record
{
read field for field
}
}

Ive made a similar report in Business Objects and there it takes 35sec to make a report of 2 tables.

Anyone got tips to speed it up with the ocx? Cfront is known to be faster but atm is way slower...

(ill post code if requested)

Comments

  • PoweRoyPoweRoy Member Posts: 43
    not requested but still the code ^^
    int k = 0;
    				fNumber = 0;
    				do
    				{
    					dRow = dTable.NewRow();
    					fNumber = cf.NextField(hTable,fNumber);
    					do
    					{	
    						/*if (fNumber == 7)//cf.FieldType(hTable,fNumber)==0)
    						{
    							object temp = fNumber;
    							cf.CalcFields(hTable,hRecord, ref temp);
    						}*/
    						dRow[k] = cf.FieldToStr(hTable, hRecord, fNumber);
    						fNumber = cf.NextField(hTable,fNumber);
    						k++;
    					} while (fNumber != 0);
    					dTable.Rows.Add(dRow);
    					k = 0;
    					fNumber = 0;
    				}while (cf.NextRec(hTable,hRecord, 1) != 0);
    

    the call:
    cf.ConnectServerAndOpenDatabase("NDBCN","","netb","NLW_NA370_P.fdb",100000,true,false,"*****","*****");
    			OpenCompany("42 - NLW Techniek");
    			OpenTable(cf.TableNo("Production BOM Line"));
    			dataGrid1.SetDataBinding(GetRecords(),"");
    

    i tried:
    - commenting the addRow (maybe that was slowing => wasnt slowing)
    - more/less cache => no difference
    - commitcache yes/no => no difference

    What are the other things i could try?
  • dick11dick11 Member Posts: 60
    Try to use the CFront.dll direct instead of the ocx.
    The ocx is a wrapper around CFront.dll

    Let us know the results.
    Dick van der Sar

    www.dasautomatisering.nl
  • PoweRoyPoweRoy Member Posts: 43
    tried that :)
    got some topics here on mibuso wich arent answered :)

    problems with reading the data out of a record

    Dont think the performance could be better for loading tables cause u have to read each records, field for field. To many operations imho.
    would be better if u could read whole records at once!

    I've got a copy of Navision 4.0 sp1 now so ill start checking the performance on that.

    Cfront is in my opinion good for reading/updating records at a time. not reading 8000> records :mrgreen:
  • PoweRoyPoweRoy Member Posts: 43
    yay getting the records with the dll works now in c# :)

    8685 records:
    C# + dll = 5sec
    C# + ocx = 1.5 minute [-(
    Business objects + odbc = 6sec
    crystal reports + odbc = 7sec
    the workbench (from this site) + odbc = 12sec
    C# + odbc = 12 sec

    well ocx goes out of the window ^^
Sign In or Register to comment.