View Issue Details

IDProjectCategoryView StatusLast Update
0006274JEDI VCL00 JVCL Componentspublic2014-04-20 19:12
ReporterbheAssigned Tojfudickar 
PrioritynormalSeveritytweakReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.47 
Target VersionFixed in Version 
Summary0006274: Improvement suggest: Faster TJvCustomAppIniStorage
DescriptionTJvCustomAppIniStorage already contains a tweak which addresses the same tweak,
but only for Delphi 2007 and only partly (see TJvMemIniFile in JvAppIniStorage.pas).
I've added a more generic class helper with an additional improvement.
See attached file.
Please migrate this in any way you want.
Additional InformationAdded code:
{$IFDEF DELPHI8_UP}
type
  /// Optimization: TMemIniFile should overwrite this methods by itself
  TMemIniFileHelper = class helper for TMemIniFile
  public
    function SectionExists(const Section: string): Boolean;
    function ValueExists(const Section, Ident: string): Boolean;
  end;

function TMemIniFileHelper.SectionExists(const Section: string): Boolean;
begin
  Result := self.FSections.IndexOf(Section) >= 0;
end;

function TMemIniFileHelper.ValueExists(const Section, Ident: string): Boolean;
var
  I: Integer;
  Strings: TStrings;
begin
  I := self.FSections.IndexOf(Section);
  if I >= 0 then
  begin
    Strings := TStringList(self.FSections.Objects[I]);
    I := Strings.IndexOfName(Ident);
    Result := I >= 0;
  end else
    Result := False;
end;
{$ENDIF DELPHI8_UP}
TagsNo tags attached.

Activities

2014-04-11 13:28

 

JvAppIniStorage.pas (28,051 bytes)

jfudickar

2014-04-16 18:31

developer   ~0020948

Did you have a small sample which helps me to test the improvement?

2014-04-17 11:44

 

AppIniFileStorageTest.zip (1,421,164 bytes)

bhe

2014-04-17 11:44

reporter   ~0020949

Attached sample takes 8100ms on my system with original implementation
and just 191ms with my little helper.

jfudickar

2014-04-20 19:12

developer   ~0020950

Thanks for this improvement.

Added to the repository

Issue History

Date Modified Username Field Change
2014-04-11 13:28 bhe New Issue
2014-04-11 13:28 bhe File Added: JvAppIniStorage.pas
2014-04-16 18:31 jfudickar Note Added: 0020948
2014-04-16 18:31 jfudickar Status new => feedback
2014-04-17 11:44 bhe File Added: AppIniFileStorageTest.zip
2014-04-17 11:44 bhe Note Added: 0020949
2014-04-20 19:12 jfudickar Note Added: 0020950
2014-04-20 19:12 jfudickar Status feedback => resolved
2014-04-20 19:12 jfudickar Resolution open => fixed
2014-04-20 19:12 jfudickar Assigned To => jfudickar