View Issue Details

IDProjectCategoryView StatusLast Update
0035091FPCRTLpublic2019-02-15 21:27
ReporterAlexey Tor.Assigned ToMichael Van Canneyt 
PrioritylowSeveritytweakReproducibilityN/A
Status closedResolutionfixed 
Product Version3.2.0Product Build 
Target Version3.2.0Fixed in Version3.3.1 
Summary0035091: Add inlines for new SysUtils funcs
Descriptionrelated to 0035047.
I see many one liners, pls add inline to them:

+function ContainsText(const AText, ASubText: string): Boolean;
+begin
+ Result := AnsiContainsText(AText, ASubText);
+end;
+
+function MatchText(const AText: string; const AValues: array of string): Boolean;
+begin
+ Result := AnsiMatchText(AText, AValues);
+end;
+
+function IndexText(const AText: string; const AValues: array of string): Integer;
+begin
+ Result := AnsiIndexText(AText, AValues);
+end;
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

J. Gareth Moreton

2019-02-15 10:50

developer   ~0114135

As of 3.3.1, they already do - check out packages/rtl-objpas/src/inc/strutils.pp, lines 39-42:

function ResemblesText(const AText, AOther: string): Boolean; inline;
function ContainsText(const AText, ASubText: string): Boolean; inline;
function MatchText(const AText: string; const AValues: array of string): Boolean; inline;
function IndexText(const AText: string; const AValues: array of string): Integer; inline;

Can you confirm they're like this for you in 3.2.0?

Thaddy de Koning

2019-02-15 14:44

reporter   ~0114148

Be careful not to over-do inlining on each and every platform and with basic units: this is detrimental on resource starved platforms. I wonder if these routines are actually inlined anyway: they are quite complex.

J. Gareth Moreton

2019-02-15 16:07

developer   ~0114151

Last edited: 2019-02-15 16:09

View 2 revisions

The functions mentioned call another function and pass through the result, and nothing else. Marking them as inline, which they already are, simply replace one function call with another and is a pure performance gain.

Michael Van Canneyt

2019-02-15 16:46

administrator   ~0114155

As said, fixed in trunk.

Issue History

Date Modified Username Field Change
2019-02-15 09:51 Alexey Tor. New Issue
2019-02-15 10:50 J. Gareth Moreton Note Added: 0114135
2019-02-15 10:52 J. Gareth Moreton Priority normal => low
2019-02-15 10:52 J. Gareth Moreton Severity minor => tweak
2019-02-15 10:52 J. Gareth Moreton Reproducibility have not tried => N/A
2019-02-15 13:51 Michael Van Canneyt Assigned To => Michael Van Canneyt
2019-02-15 13:51 Michael Van Canneyt Status new => assigned
2019-02-15 14:44 Thaddy de Koning Note Added: 0114148
2019-02-15 16:07 J. Gareth Moreton Note Added: 0114151
2019-02-15 16:09 J. Gareth Moreton Note Edited: 0114151 View Revisions
2019-02-15 16:46 Michael Van Canneyt Note Added: 0114155
2019-02-15 16:46 Michael Van Canneyt Status assigned => resolved
2019-02-15 16:46 Michael Van Canneyt Fixed in Version => 3.3.1
2019-02-15 16:46 Michael Van Canneyt Resolution open => fixed
2019-02-15 16:46 Michael Van Canneyt Target Version => 3.2.0
2019-02-15 21:27 Alexey Tor. Status resolved => closed