Started to do a bit of profiling on this as, whilst the CM4 is fairly hefty as far as embedded systems are concerned, it's no Apple Silicon.
Biggest performance sink was dealing with metering information coming from other MCUs onboard, which is at a fairly slow rate of 10Hz (well, was 30Hz, but I slowed it down). We are using Codable to implement the serialisation of the control protocol (OCP.1, part of AES70), and Codable is slooooow. More specifically, it's the Swift runtime cost (checking for protocol conformance). This also impacted some other errors where we were, for example, using protocol conformance to check whether a particular event was a metering event or not. Hand-rolling some of the serialisation code and also using more efficient checks elsewhere reduced CPU usage considerably.
The other culprit was malloc() in ContiguousArrayBuffer as used by AsyncChannel. Curtailing the use of AsyncChannel also improved things.
