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:
Seconds | Where | Xojo Version |
---|---|---|
57.876 | Debugger | Xojo 2022r4 |
31.566 | Built App | Xojo 2022r4 |
19.456 | Debugger | Xojo 2023r4 |
0.620 | Built App | Xojo 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:
Seconds | Where | Xojo Version |
---|---|---|
99.839 | Debugger | Xojo 2022r4 |
70.906 | Built App | Xojo 2022r4 |
25.665 | Debugger | Xojo 2023r4 |
6.065 | Built App | Xojo 2023r4 |
CLong function
Now let's check if CLong got faster. One of the many utility functions to convert from string to integer:
Seconds | Where | Xojo Version |
---|---|---|
70.290 | Debugger | Xojo 2022r4 |
37.520 | Built App | Xojo 2022r4 |
4.500 | Debugger | Xojo 2023r4 |
1.407 | Built App | Xojo 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:
Seconds | Where | Xojo Version |
---|---|---|
113.888 | Debugger | Xojo 2022r4 |
33.636 | Built App | Xojo 2022r4 |
23.835 | Debugger | Xojo 2023r4 |
0.815 | Built App | Xojo 2023r4 |
BackgroundTasks
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.
Seconds | Where | Xojo Version |
---|---|---|
13.801 | Debugger | Xojo 2022r4 |
1.128 | Built App | Xojo 2022r4 |
9.919 | Debugger | Xojo 2023r4 |
0.583 | Built App | Xojo 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.