Fast logging to file for real time use? or ZeroMQ or similar?

I want to log some metrics for my audio app so I can analyse/plot after with python. I used the Juce performanceCounter to time the fileLogger. Seems to take 30ms to 50 ms to log a small amount of text?? Apparently ZeroMQ takes a few uS so will look into that together with some python, unless there is something else I should consider?


imho if you’re going to be looking at the output from an audio process in real time you should be writing the output to an audio file. You can use the AudioFormatWriter classes to do that.

What I usually do for more granular analysis is to generate all the data offline. For example, I’ve written unit tests where in the case of failure they’ll either print data to the console (easy for copy/pasting into MATLAB) or write the signal to a text file. No fancy logging utilities required honestly.

Thanks @Holy_City thats interesting. I want to generate json / XML type metrics at say 200 Hz. I wonder if this is going to pain to serialise into audio?

You can write the data to a text file (or whatever you need) and then run your python as a post-build script.

That’s the plan, but I’m finding the write to text process slow (30 ms - 50ms) unless I’m doing something wrong. I guess I could buffer to memory then write to file, but I don’t want to be constrained only using the app for short* durations.

*need to calculate!

Devendra Parakh talks about realtime logging in his ADC talk:


Devendra kindly replied

It was in the presentation (last slide, but I guess it didn’t show up in the video!):