« MBS Xojo Plugins, ver… | Home | Upcoming changes for … »

Benchmarking improvements in Xojo 2023r4

A few weeks ago, I had a blog post about Performance improvements in Xojo. Now that Xojo 2023r4 version is available, we got a few benchmarks to verify if things are faster.

Stack Overflow Check

Let's test the improved stack overflow check. The test application basically performs a few loops to run about one million function calls. Each function call performs a stack check, so doing a million stack checks takes some time. Our test shows this improvement for StackOverflowChecking:

SecondsWhereXojo Version
57.876DebuggerXojo 2022r4
31.566Built AppXojo 2022r4
19.456DebuggerXojo 2023r4
0.620Built AppXojo 2023r4

You notice that the debugger is now running the app faster than it used to be in the built app.

Main Thread Check

Then we check the improvement of the main thread check in control getters. Whenever you access a control method or property, Xojo will check for whether you are in the main thread. This check got improved in the new version. Here are the result for our UITrap performance check:

SecondsWhereXojo Version
99.839DebuggerXojo 2022r4
70.906Built AppXojo 2022r4
25.665DebuggerXojo 2023r4
6.065Built AppXojo 2023r4

CLong function

Now let's check if CLong got faster. One of the many utility functions to convert from string to integer:

SecondsWhereXojo Version
70.290DebuggerXojo 2022r4
37.520Built AppXojo 2022r4
4.500DebuggerXojo 2023r4
1.407Built AppXojo 2023r4

IsEmpty function

While we learnt that checking with = "" is faster, some users still prefer calling IsEmpty for better code readability. Since this function was improved from checking byte count instead of counting characters, it is now much faster. Let's check:

SecondsWhereXojo Version
113.888DebuggerXojo 2022r4
33.636Built AppXojo 2022r4
23.835DebuggerXojo 2023r4
0.815Built AppXojo 2023r4


And now we can test with BackgroundTasks on to see how much that takes. Each loop calls internally a function to check if scheduler needs to switch to a different thread. This functions got optimized, so it is now faster.

SecondsWhereXojo Version
13.801DebuggerXojo 2022r4
1.128Built AppXojo 2022r4
9.919DebuggerXojo 2023r4
0.583Built AppXojo 2023r4

All test made on a MacBook Pro with M2 and with default optimization level.

Real world?

The optimization is great news for all Xojo users. The IDE is snappier, the built applications work better. Your milage may vary, but especially web projects with their framework in Xojo call a ton of methods and there you benefit a lot here.

Does it affect your application? Maybe. If your application us mostly waiting for user input, network packets or disk I/O, then you may not notice it. But if you have loops doing some processing of data, you may see a benefit.

Please try the new version and let us know how well it works. Of course we keep an eye open for more potential optimizations.

The biggest plugin in space...
14 12 23 - 10:13