Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@Ranchonyx Every node task (pgrep - pids of process(es) with name node) gets a higher scheduler priority.
-20 - scheduler prioritizes highest (best)
0 - default
+20 - scheduler prioritizes lowest (worst)
Though the code is wrong.
No validation of error code. Meaning that it's not guaranteed that the priority was actually changed at all.
It can make sense when you have a fuckton of open applications as for some reason you don't like closing applications - the scheduler then prioritizes the process with the lowest priority.
Though this doesn't need to be a good thing.
After all, we're talking just about scheduling here (CPU) -
@Ranchonyx
Resource hungry, mem hogging piece of shit.
While there is a difference if it's just CPU usage, as soon as e.g. I/O is the bottleneck it doesn't do much.
I'd consider it an "pseudo" optimization at best... Relevant maybe for desktop, but even there limited just to the CPU scheduling. -
lopu8843yI've been using on my new M1 powered MacBook pro for work, my computer used to slow down a ton on rebuilds of yarn projects, even my music would start playing choppy, but since lowering the priority of node processes it doesn't interfere with my other programs, the whole computer doesn't slow down which is great
Related Rants
thank me later
deprionode() { for f in $(pgrep 'node'); do renice +20 -p $f; done ;}; export -f deprionode
prionode() { for f in $(pgrep 'node'); do renice 0 -p $f; done ;}; export -f prionode
Especially if you run a MacBook pro
rant
node
apple
m1