Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0006275 [JEDI VCL] 00 JVCL Components major always 2014-04-22 17:42 2015-09-14 13:20
Reporter bazilio View Status public  
Assigned To AHUser
Priority normal Resolution fixed  
Status resolved   Product Version Daily / GIT
Summary 0006275: Very poor performance of JvMemoryData on large datasets
Description We have heavy application for TJvMemoryData. It have few dynamically JV memorydataset with 100-200 fields and 10-100 rows. During perfoformance tuning of our application we reached following strange behavior of TJvMemory. Direct access via TField of first fields is fast but access to last fields is very slow.
  After investigation I found that the

TJvMemoryData.FindFieldData(Buffer: Pointer; Field: TField): Pointer;
contains very suspicious code

var
  Index: Integer;
  DataType: TFieldType;
begin
  Result := nil;
  if Length(FCopyFromDataSetFieldDefs) > 0 then
    Index := FCopyFromDataSetFieldDefs[Field.Index]
  else
    Index := FieldDefList.IndexOf(Field.FullName);

IndexOf(Field.FullName)!!!!! instead of access through Field.Index/

I wrote very little patch to avoid this.
Test project attached.
Any comments?
Additional Information
Tags No tags attached.
Attached Files zip file icon JVMemoryDataTest.zip [^] (11,536 bytes) 2014-04-22 17:42

- Relationships

-  Notes
(0020953)
AHUser (developer)
2014-04-24 22:54

Using Field.Index won't work if you make the CalcField the first field because then Field.Index is off by one. But using "Field.FieldNo - 1" is the solution.

I also made the Open and the CopyFromDataSet much faster. With the change to Field.FieldNo the FCopyFromDataSetFieldDefs array isn't necessary anymore.


Solved in master branch.

- Issue History
Date Modified Username Field Change
2014-04-22 17:42 bazilio New Issue
2014-04-22 17:42 bazilio File Added: JVMemoryDataTest.zip
2014-04-24 22:54 AHUser Note Added: 0020953
2014-04-24 22:54 AHUser Status new => resolved
2014-04-24 22:54 AHUser Fixed in Version => Daily / GIT
2014-04-24 22:54 AHUser Resolution open => fixed
2014-04-24 22:54 AHUser Assigned To => AHUser
2015-09-14 13:20 obones Fixed in Version Daily / GIT => 3.48


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker