2023r4 performance improvements

Expect a speedup with 2023r4 of 2x-10x, or even more. I can’t even explain how dramatic it can be.

For example, in my Advent of Code project, one solution took about 8 MINUTES to complete. In the new build, the exact same code took about 25 SECONDS.

No, none of that is a typo.

(I’ve since revised that code so it’s faster anyway, but the old code is still in old commits if anyone wants to try.)

A big thanks to MVP @Christian_Schmitz for identifying and offering a solution to this performance bottleneck.

28 Likes

Thanks again @Christian_Schmitz for the pusing towards this fix…:wink:
Almost forgot to thank Xojo for actually releasing this hyper-speedup…:wink:

3 Likes

To illustrate the point, this is a sample of my Advent of Code project compiled in 2023r3.1:

And in 2023r4:

No changes in code, just recompiled for ARM in each version, then run side by side on my Mac just now.

Note, for instance, 2022 days 23 and 24. I haven’t been this excited about a Xojo version in … well, a long time.

4 Likes

I’ll take your word for it. Probably it’s my aging eyeballs :slight_smile: , but I can’t see any obvious differences in the two pictures. What are we looking at?

1 Like

Look at the pale grey numbers:

image

They are hard to see !

They are hard to see !
On my monitor, in the original images, literally impossible. Thank you for the zoomed in pics.

1 Like

I’ll repost what I wrote in the testers forum for those who don’t have access to that area about the performance:

I cannot emphasise enough how incredible an improvement @Christian_Schmitz’s stack-checking suggestion and its subsequent implementation has made to the performance of the entire framework!

To provide some numbers…

My VM scripting language, ObjoScript, that is written entirely in Xojo has seen about a 5-6x increase in performance. The test suite of 332 scripts used to take 11.2 seconds to run and now does it in under 3 seconds. My deep recursion Fibonacci test script went from 249,082 milliseconds to 47,686 ms!

My port of Box2D has seen a 10-50x increase in speed. The demo app illustrates this nicely. For example, the particle demo with 2000 particles used to take about 20 ms per step to complete and now takes about 0.2 ms!

Absolutely amazing work Xojo.

14 Likes

(Grinch mode, sadly…)
I upgraded and ran some tests.
On my own key ‘pain point’, the 2023 version actually appears to run slower, by about 25%
(Tested by timing 100 iterations)
I’m expecting/hoping that other areas may compensate.

I use MBS stuff too, so nothing is pure Xojo, and because of the nature of my app, tiny differences can make a cumulative impact.

A few years ago, for example, a small ‘improvement’ in one plugin call doubled the per-call time.
Call it once, and you don’t notice… it’s fast enough, and the improvement justifies it.
Call it a million times (as I was having to do) , and wham… It’s possible that Im seeing similar again now, as I was forced to update all the plugins to make 2023 work

Maybe you can present your case to MBS for investigation. Sample project, plugin versions, Xojo versions, etc.

Maybe that will result in an update that will help make things faster.

Maybe. This is why I am resistant to upgrades.
It will take me a long time to track down which specifc function call/s are slower… there are (at least ) hundreds of lines of code in this area. It’s a slight downer as I was hoping to be able to ride the coattails of the Xojo speedup and pass it on to my own customers. More testing continues

If your app is on macOS, you should run it using Instruments.app using the Time Profiler tool, which will show you a call tree of each function and how long it takes to run. My app is cross platform (macOS / Windows) and fixing performance issues on the macOS version often makes similar improvements on the Windows version.

4 Likes

What is that pain point?

-Karen

What is that pain point?

A very large x/y loop that does a lot of drawing /bitmap placement.
Every millisecond counts.
It’s the sheer volume of operations which it contains that exposes any loss of performance.
If you remove one peanut from every bag sold, the bag seems very similar, but the company makes a lot more profit.
Add a peanut to each bag and the individual bag doesn’t seem much different, but there is a big impact on the bottom line when you consider thousands in the aggregate. It’s that kind of thing.
Profiling is unlikely to help (even if it worked) as it reports on whole methods, not ‘lines of code’
I shouldn’t have posted here… the slowdown is almost certainly not at the door of Xojo code.

The Instruments Time Profiler is quite a bit more powerful than the Xojo one, since it will show you time used not only in Xojo code but in all OS APIs you are using.

Yeah, perhaps we are drifting off topic?

If you would like help, suggest you post a new thread with some code snippets and I’m sure several folks on the forums would be able to offer tips.

2 Likes

You’ve just summed up Tim Cook’s entire business mantra, less for you is more for the people he actually cares about, him, the board and shareholders.

2 Likes

I’m not sure why you’re singling out Apple and its CEO here. Reducing the cost of manufacture, delivery, support, etc. is the goal of every business.

2 Likes

RAM and SSD prices…

-Karen

2 Likes

Well isn’t that the definition of capitalism ?

Besides’ I think no one is forced to buy Apple products. I type this comment on a Windows computer. I have two of them. But I also own two Macs, and I prefer macks over Windows. Each patch Tuesday is a nightmare, after all these years Microsoft has noy yet found how to apply patches :rage:.

1 Like

I’m singling out Tim Cook, because as an ex-employee it’s so sad to watch the people around me get fed up with the products designed under his leadership. A number of friends and family, have already moved on.

I’ve also been exposed to a far more serious problem. There is a growing number of people who invest tens of thousands of dollars into Apple’s products in a field that Apple used to reign, only to be faced with unreliable & un-repairable hardware, unstable software and problems that Apple appears to have no interest in fixing.

The Mac App Store was kinda awesome, and then it became Cookified…

offtopic, useless and unjustified rant, not a first
apple products are solid