View Issue Details

IDProjectCategoryView StatusLast Update
0020455FPCCompilerpublic2011-10-21 05:47
ReporterMartin Friebe Assigned ToPaul Ishenin  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionnot fixable 
Platformw32OSwin 
Product Version2.7.1 
Fixed in Version3.0.0 
Summary0020455: fpc trunk slower by magnitude of 5 or more (probably string related)
DescriptionIf I run the attached project compiled with fpc trunk (maybe a week old), it runs 5 times slower than when compiled with fpc 2.4.4

If you check Lazarus components/LazUtils/LazUtf.pas
There are several similar routines. Not all of them are affected. But the attached is.
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

2011-10-10 15:51

 

project1.rar (3,683 bytes)

Paul Ishenin

2011-10-21 05:47

developer   ~0053222

The problem is that compiler can't know what is the source encoding of the supplied program. As result it uses default compiler encoding (cp8859-1) and converts UTF8 string data from that encoding to UTF8 (because you are using utf8string type which has explicit UTF8 codepage set).

There are few possibilities to return to old speed:
1) replace UTF8String with AnsiString
2) place UTF8 bom at the beginning of the unit
3) set {$codepage UTF8} at the top of the unit
4) pass codepage argument to the compiler (ppc386 -FcUTF8 project1.lpr)

Issue History

Date Modified Username Field Change
2011-10-10 15:51 Martin Friebe New Issue
2011-10-10 15:51 Martin Friebe File Added: project1.rar
2011-10-11 13:44 Paul Ishenin Status new => assigned
2011-10-11 13:44 Paul Ishenin Assigned To => Paul Ishenin
2011-10-21 05:47 Paul Ishenin Status assigned => resolved
2011-10-21 05:47 Paul Ishenin Fixed in Version => 2.7.1
2011-10-21 05:47 Paul Ishenin Resolution open => not fixable
2011-10-21 05:47 Paul Ishenin Note Added: 0053222