QB64-Phoenix-Edition / QB64pe

The QB64 Phoenix Edition Repository
https://qb64phoenix.com
Other
124 stars 26 forks source link

Optimize string addition somewhat to reduce IDE lag #502

Closed SteveMcNeill closed 3 months ago

SteveMcNeill commented 3 months ago

Very simple change here, to basically take:

a$ = b$ + c$ + d$ + e$ + f$

And make it:

a$ = b$ + (c$ + d$ + e$) + f$

....

This speeds up the IDE due to (c$ + d$ + e$) being small strings, while a$ and f$ are larger strings... It's more efficient to move and add those small strings first, than it is to add them to the large strings, making them larger, at each step.