2 ms·
It's funny you linked to my random post. I should probably follow up on that as it'd be a nice way to ensure you're not allocating on hot-paths. It'd be for aud
by elcritch 5y ago
It's funny you linked to my random post. I should probably follow up on that as it'd be a nice way to ensure you're not allocating on hot-paths. It'd be for audio processing and such!
Overall I'm finding Nim performs well at real-time style processing with ARC – even when allocating memory. Its memory allocator is taken from research for embedded real time allocation. Still the best pattern is to pass memory as mutable variables on hot processing paths:
proc processAudio(someBuffer: openArray[byte]) = ...
Next couple of weeks I'll using Nim on an MCU taking real-time ADC readings at ~64khz. That'll be fun as it'll require interfacing pre-allocated DMA buffers and with multithreaded ARC managed buffers. And they say it's all web programming nowadays. ;)