Tracked down that last 3mb of memory usage, making the new implementation almost 4x faster than the old one (for the second set of test data) and uses 8Kb instead of 240Mb.
I’ve got one more performance experiment I want to try then I’ll be taking a closer look at the line breaking algorithm (but I think it might be ok as is).
Ah, the joys of code optimisation. I still remember the heady days of the late 80s when you really had to squeeze very last drop out of processor performance. Often that meant dropping to assembly language (as high level language compilers were still not brilliant in terms of code efficiency), overlapping integer and floating point unit operations (a floating point multiply might take, for example, 20 clock cycles, during which you could do several integer operations before needing the floating point result), keeping variables in processor registers to avoid unnecessary memory writes, etc. , etc.
I remember demonstrating to a sceptical former boss a “Sobel” convolution edge detection image processing algorithm running over 20 times faster in assembly language compared to the PDP11 Fortran equivalent.
These days, I’ll just buy a faster processor or more memory but there was a certain satisfaction when you got something running on steroids in the old days, so hopefully Brad is feeling the same way right now over this!
So, huge Kudos to what Brad is doing on this area. Sounds like real progress that will benefit Cantabile as a multi-national/language platform (just look at the spread of users on the “where are you from” thread).
Ladies and gentlemen, I think it’s fair to say we’re watching some truly world class software development unfold before our eyes here. There’s nobody I’d rather have at the helm of Cantabile development, and I’m really excited to see how this major feature work pans out!!
Awe-inspiring work @brad! Just don’t burn yourself out!!!
The improvements to Cantabile’s text rendering are pretty much done now. They solve a whole bunch of rendering issues and form a good foundation for more work on show notes going forward. I’m now going to switch away from this work for a bit to focus on some other high-priority things but will return to show notes improvements soon.
Quick question: do you like these very development centric posts and would you like to see more of them, or do you prefer be surprised when a new build ships with something new in it?
I like it very much to be part somehow of the improvements and that we’re able to follow up. If it doesn’t add to much pressure on your work, it’s a good thing.