Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How does this deal with throttling those operations? Like, if I’m converting 100 or 1000 PNGs to Webp, I probably only want 12-ish operations going on at a time so my CPU isn’t context-switching like crazy and the PNGs don’t all load into RAM at once.


They're using GNU parallel, which will default to the number of CPU threads available, but which can be tweaked to your liking.

https://www.gnu.org/software/parallel/sphinx.html


While I love GNU Parallel there's also the venerable (and installed by default) xargs.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: