[Gambas-user] trimming extra spaces from within a string.

Brian G brian at westwoodsvcs.com
Tue Nov 10 16:39:14 CET 2020

Yes My function does rely on fast unsafe and does cause a penalty when the app first start for the compile...
The string@ or pointer@ use a lot of overhead when not used with unsafe.

But even just fast unsafe on this one function pays off.

Also notice that using anything but integers as counters seems to seriously slow down functions

Note: My regex example did not come from Tobi.... Lol

Thank You
Brian G

----- Original Message -----
From: "Christof Thalhofer" <chrisml at deganius.de>
To: "Gambas mailing list" <user at lists.gambas-basic.org>
Sent: Tuesday, November 10, 2020 3:03:33 AM
Subject: Re: [Gambas-user] trimming extra spaces from within a string.

Am 10.11.20 um 05:57 schrieb Brian G:

> Hi sorry to be late to the party, I included a project with all the
> methods mentioned. I have included my version of the remove spaces 
> using alloc and pointers in gambas, it is faster if it is over 5000
> characters. Run the project with profiling on.

Yes it (fixstring) is much faster but only with 'Fast Unsafe', otherwise
it is much slower (about 400 times!).

Interestingly all other methods do not benefit from 'Fast'.

And the editor in the IDE is heavily broken with 'Fast Unsafe Public Sub'.

Alles Gute

Christof Thalhofer

Dies ist keine Signatur

----[ http://gambaswiki.org/wiki/doc/netiquette ]----

More information about the User mailing list