View Issue Details

IDProjectCategoryView StatusLast Update
0005709JEDI VCL00 JVCL Componentspublic2013-12-13 11:29
ReporterKarlheinzAssigned Toobones 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionsuspended 
PlatformOSWin7 64bitOS Version
Product VersionDaily / GIT 
Target VersionFixed in Version 
Summary0005709: Very slow behavior of procedure TJvDBCustomSearchComboBox.ReadList;
DescriptionI use TJvDBCustomSearchComboBox in my application with ElevateDB.
The loas of the List is very, very slow.
Maybe it has soemthing to do with the new Bookmark handling since d12.
My Dataset has arround 6000 records and it takes at an i5 processore around 5 seconds to read the list.
TagsNo tags attached.

Activities

AHUser

2011-11-13 11:06

developer   ~0019110

A test project with a memory ClientDataSet with 6000 records didn't show me the performance hit that you experience. Despite, I made some small changes to the control like putting a BeginUpdate/EndUpdate block around the ReadList method and moving the FieldByName call above the loop, so it is executed only once.

Karlheinz

2011-11-13 14:42

reporter   ~0019111

I have added with Codesite the following time log. Below you can see the procedure with the codesite lines.

begin14:32:14
direct after try 1 14:32:14
direct after try 2 14:32:14
direct before while start 14:32:14
direct after while end 14:32:17
begin14:32:17
direct after try 1 14:32:17
direct after try 2 14:32:17
direct before while start 14:32:17
direct after while end 14:32:19
direct before end of finally 2 14:32:19
direct before end of finally 1 14:32:19
direct after end of try finally 1 14:32:19
End 14:32:19
direct before end of finally 2 14:32:19
direct before end of finally 1 14:32:19
direct after end of try finally 1 14:32:19
End 14:32:19


procedure TJvDBCustomSearchComboBox.ReadList;
var
  Bmrk: {$IFDEF RTL200_UP}TBookmark{$ELSE}TBookmarkStr{$ENDIF RTL200_UP};
  N, CurIndex: Integer;
  DataSet: TDataSet;
  Field: TField;
begin
  CodeSite.Send('begin'+TimeToStr(now));
  if (FDataLink.DataField = nil) or (FDataLink.DataSet = nil) or not FDataLink.DataSet.Active then
    Exit;
  Items.BeginUpdate;
  try
    CodeSite.Send('direct after try 1 '+TimeToStr(now));
    DataSet := FDataLink.DataSet;
    ClearList;
    CurIndex := -1;
    Bmrk := DataSet.Bookmark;
    DataSet.DisableControls;
    N := 0;
    try
      CodeSite.Send('direct after try 2 '+TimeToStr(now));
      Field := DataSet.FieldByName(FDataLink.FDataFieldName);
      DataSet.First;
      CodeSite.Send('direct before while start '+TimeToStr(now));
      while not DataSet.Eof do
      begin
// CodeSite.Send('while not dataset.eof begin and N =' + IntToStr(N) + ' ' + TimeToStr(now));
        FBookmarks.Add(DataSet.GetBookmark);
        Items.AddObject(Field.DisplayText, TObject(FBookmarks[N]));
        if {$IFDEF RTL200_UP}DataSet.CompareBookmarks(DataSet.Bookmark, Bmrk) = 0{$ELSE}DataSet.Bookmark = Bmrk{$ENDIF RTL200} then
          CurIndex := N;
        Inc(N);
        DataSet.Next;
      end;
      CodeSite.Send('direct after while end '+TimeToStr(now));
      DataSet.Bookmark := Bmrk;
    finally
      DataSet.EnableControls;
      CodeSite.Send('direct before end of finally 2 '+TimeToStr(now));
    end;
  finally
    Items.EndUpdate;
    CodeSite.Send('direct before end of finally 1 '+TimeToStr(now));
  end;
    CodeSite.Send('direct after end of try finally 1 '+TimeToStr(now));
  ItemIndex := CurIndex;
  CodeSite.Send('End '+TimeToStr(now));
end;

obones

2012-02-22 14:46

administrator   ~0019443

Any progress here?

obones

2012-06-13 16:28

administrator   ~0019967

Any news?

obones

2013-12-13 11:29

administrator   ~0020782

No news, suspending the issue

Issue History

Date Modified Username Field Change
2011-11-13 09:33 Karlheinz New Issue
2011-11-13 11:06 AHUser Note Added: 0019110
2011-11-13 11:06 AHUser Status new => feedback
2011-11-13 14:42 Karlheinz Note Added: 0019111
2012-02-22 14:46 obones Note Added: 0019443
2012-06-13 16:28 obones Note Added: 0019967
2013-12-13 11:29 obones Note Added: 0020782
2013-12-13 11:29 obones Status feedback => resolved
2013-12-13 11:29 obones Resolution open => suspended
2013-12-13 11:29 obones Assigned To => obones