Barebone - Running the strict minimum for a nodescript


I am running a node.js script that sends a “byte” to a UART TX pin every 10ms.

Looking at the pin with a logic analyser, I can see that the bone has a hard time keeping up with the 10ms and I suspect that I have too many unnecessary tasks/daemons running in the background.

The logic analyser shows that 80% of the time, I get 10ms ±1 and 10% of the time it periodically gets as bad as 20ms.

What background stuff can I safely stop to run a node script?

Thank you

I suspect it's not background tasks, but just the overhead of getting from bonescript to the UART. There are a lot of places that might be causing the delay. Have you tried sending a single byte from a C program, to see if it's in the bonescript interpretation?

Nodejs should not be much slower than C code in execution. I have noticed that a script can sometimes take 2-5 seconds to start, but once running it is usually responsive. However, I have not really checked timing at a 10ms interval. I also do not use any standard packages( in this regard ), as I built my own Nodejs natively. No bonescript, and my “app” directly calls an executable ( C / stdlib executable ).

As for exactly what processes I have running in the background, I could not say 100% at this moment - as I am / will be away from my dev systems for a few days yet. I can say however that I do have less than 10 processes running “stock”, of which one is init.

This is a custom, and very bare system though, with roughly 480M ram left available while the Nodejs script is running. Basically think . . . using Roberts barefs rootfs. Then with only a self compiled version of Nodejs, with express 3.x and

Oh, and as for the C executable, it sits at around 178K total compiled size. SO fairly small.

Sorry, the internet where I am currently is rather spotty and I tried making modifications to priors posts and . . . Yeah post do not seem to be working correctly. Anyhow 480M ram free while running and my rootfs is roughly 178M in size on an NFS share. Still working on it etc, but I could give details as to what I’ve done so far later. As I keep a “build log” of everything I do as I do it.