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
0006274 [JEDI VCL] 00 JVCL Components tweak always 2014-04-11 13:28 2014-04-20 19:12
Reporter bhe View Status public  
Assigned To jfudickar
Priority normal Resolution fixed  
Status resolved   Product Version 3.47
Summary 0006274: Improvement suggest: Faster TJvCustomAppIniStorage
Description TJvCustomAppIniStorage 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 Information Added 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}
Tags No tags attached.
Attached Files ? file icon JvAppIniStorage.pas [^] (28,051 bytes) 2014-04-11 13:28
zip file icon AppIniFileStorageTest.zip [^] (1,421,164 bytes) 2014-04-17 11:44

- Relationships

-  Notes
(0020948)
jfudickar (developer)
2014-04-16 18:31

Did you have a small sample which helps me to test the improvement?
(0020949)
bhe (reporter)
2014-04-17 11:44

Attached sample takes 8100ms on my system with original implementation
and just 191ms with my little helper.
(0020950)
jfudickar (developer)
2014-04-20 19:12

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
2014-07-01 22:54 blacksmile Issue Monitored: blacksmile


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