[Lazarus] IsFontNameDefault talk

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Lazarus] IsFontNameDefault talk

Free Pascal - Lazarus mailing list
Juha,

you tell that "if LowerCase(s)='default'"

works faster than "if CompareText(s,'default')", but most of the fonts,
dont start with letter "d" or "de"=> so CompareText takes one char only,
LowerCase takes n chars=> LowerCase slower.

--
Regards,
Alexey

--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] IsFontNameDefault talk

Free Pascal - Lazarus mailing list
On Sun, Jun 4, 2017 at 3:36 PM, Alexey via Lazarus
<[hidden email]> wrote:
> you tell that "if LowerCase(s)='default'"
> works faster than "if CompareText(s,'default')", but most of the fonts, dont
> start with letter "d" or "de"=> so CompareText takes one char only,
> LowerCase takes n chars=> LowerCase slower.

Yes, actually I realized the same thing.
What more, CompareText() is well optimized and converts ASCII chars
quickly one by one.
I can change the code later to use CompareText().

Another thing is that GUI + font handling itself is slow compared to a
string comparison which makes this issue rather philosophical...

Juha
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Loading...