View Issue Details

IDProjectCategoryView StatusLast Update
0038044FPCPackagespublic2020-11-05 21:55
Reporterprino Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Fixed in Version3.3.1 
Summary0038044: Inefficient code
Descriptionfpcbuild-3.2.0.zip\fpcbuild-3.2.0\fpcsrc\packages\rtl-objpas\src\inc\strutils.pp, lines 358 & 496:

while (aPattern[aPos-i] = aPattern[aPatternSize-1-i]) and (i < aPos) do begin

Not a bug, but anyone with any sense would reverse the two tests, given that the first is far more computationally intensive.

And why isn't "ResizeAllocatedMatches" inlined?

TagsNo tags attached.
Fixed in Revision47327
FPCOldBugId
FPCTarget3.2.2
Attached Files

Activities

Michael Van Canneyt

2020-11-05 21:55

administrator   ~0126764

I doubt the difference will be noticeable in real-world situations, but I applied the change.

Using inline is meanwhile discouraged, the idea is to make the compiler smart enough to know when it is advantageous to inline or not.

Issue History

Date Modified Username Field Change
2020-11-05 20:43 prino New Issue
2020-11-05 21:35 Bart Broersma Project Packages => FPC
2020-11-05 21:55 Michael Van Canneyt Assigned To => Michael Van Canneyt
2020-11-05 21:55 Michael Van Canneyt Status new => resolved
2020-11-05 21:55 Michael Van Canneyt Resolution open => fixed
2020-11-05 21:55 Michael Van Canneyt Fixed in Version => 3.3.1
2020-11-05 21:55 Michael Van Canneyt Fixed in Revision => 47327
2020-11-05 21:55 Michael Van Canneyt FPCTarget => 3.2.2
2020-11-05 21:55 Michael Van Canneyt Note Added: 0126764