[fpc-pascal] Not specifying the {$H+} degrades performance

Graeme Geldenhuys graemeg.lists at gmail.com
Mon Mar 26 12:54:09 CEST 2007


If I have a .pas unit and forgot to specify the compiler mode line
   {$mode objfpc}{$H+}
what does FPC default to? Compiler Mode? Longstring or Shortstring?

I wrote a string tokenizer and did some time trials against an old
tokenizer I used.  First I forgot to include the compiler mode line
above and did some test runs.  I then noticed my mistake and added in
that line and did some more test runs.  The second set of tests where
on avg 10% faster!

After some more testing I realized it is the {$H+} that gave me the
performance boost.  What does FPC default to? Why not default to {$H+}

Lazarus added the following compiler parameters:
 -S2cgi -OG1 -gl -vewnhi -l
-Fu/opt/lazarus/packager/units/i386-linux/ -Fu. -ofpcunitproject1
-dUseCThreads -dLCL -dLCLgtk

Graeme Geldenhuys

There's no place like S34° 03.168'  E018° 49.342'

More information about the fpc-pascal mailing list