@Sebastiano I use standalone to create one multi-page document where each iteration of the animation is a page. Then ImageMagick's convert to turn that PDF into an animated GIF (but don't ask me about the exact options to convert -- I forgot).
@mickep I was wrong, it did run all of it (it is using latexmk -pdf -g, I thought it was missing the -g and just ignoring the files, but all the aux etc output files are updated). The main thing is that it is sending all output to /dev/null, I think that also help. So almost 250 files in 20sec.
(I totally blame the Context group for my new obsession with string art) In case there are more victims, I found this generator on github: github.com/halfmonty/StringArtGenerator
@Skillmon Though my full book still takes approx 45sec for a single pdflatex run. Here's where I'd like to optimize so the code don't need to write to disk and input twice. We'll see when I get to it.
@Skillmon Thanks. I'll see what I can come up with first. The code for this env was started over 15years ago and it can do a lot of strange tings. Probably time for a rewrite.
@daleif My experience is that (at least on Linux) if the files are not big, there is little advantage --- all operations occur in the cache normally, so the disk is hit only at the end. But I'd love to speed up the compilation of circuitikz manual --- the huge number of LTXexamples is a problem for me (more than 3 minutes on a Ryzen 9 + 32 G of RAM)
@daleif yes, it's on GitHub: github.com/circuitikz/circuitikz. To build the manual, you need pandoc (for the Changelog, but that's not essential) and make manual from the top.