Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2008-09

patch for ReadInteger in sysformt.inc

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Markus Beth

Hi,

latest profiling of one of our FPC applications showed ReadInteger (in rtl/objpas/sysutils/sysformt.inc) to be a performance bottleneck. Using Pos(Fmt[chpos],'1234567890')0 to check if Fmt[chpos] is a digit is somewhat time consuming. I replaced it with two char comparisons with '0' and '9'.
The rest of the patch only unifies the casing of the variable chpos.

Markus

Reply by email

Florian Klaempfl
to Markus Beth
Show quoted text 8 lines
Hi, latest profiling of one of our FPC applications showed ReadInteger (in rtl/objpas/sysutils/sysformt.inc) to be a performance bottleneck. Using Pos(Fmt[chpos],'1234567890')0 to check if Fmt[chpos] is a digit is somewhat time consuming. I replaced it with two char comparisons with '0' and '9'. The rest of the patch only unifies the casing of the variable chpos.

Thanks! Applied.

Reply by email