I’m doing a lot of printing to console and for sure it’s obvs not really that necessary beyond debugging. I was very surprised to find out that it was slowing a sketch down enormously! Perhaps that’s my naivety but it seems like a bug?
Are there any general resources for a processing noob regarding sketch optimisation?
No – it would be nice, although optimisation / optimization tends to depend a lot on what you are doing. For example, 1) printing to the console can be slow 2) the first call to text() can cause lag, on that frame only 3) there are memory efficient ways of dealing with frame buffers if you are trying to time-delay video … and if you are doing trig, it helps to pre-compute expensive parts that you re-use many times… but, in general, there are so many different ways to optimize that it depends a lot on what kind of sketch it is.
So, just ask for help on individual optimization tasks. Many of them people have seen before. If you really want to get deep into it, I would recommend a general survey of the underlying language features (in this case, Java) such as:
Thanks for taking the time to respond. I’m self taught from a very young age so have lots of sloppy processes in me. My question was always: “but does it float?” I never much cared for efficiency till recently. I have started also to admire the aesthetics of elegant code as much as benefits in performance.
Thanks again for your reply. I’ll surely ask more questions
Great! Many here are self-taught, in whole or in part, and we are all still learning. When working on a project basis, optimization tends to become more interesting once it is needed (which often seems the right way to prioritize it). Some design patterns and best practices come with time and experience.