Sjors / nado-book

Bitcoin: A Work in Progress (book source code)
https://btcwip.com
Other
66 stars 14 forks source link

Building paperback is slow #50

Open Sjors opened 1 year ago

Sjors commented 1 year ago

./make_book.sh --paperback takes really long for me.

On a 2019 Macbook Pro (2,3 GHz 8-Core Intel Core i9):

165,75s user 21,38s system 99% cpu 3:07,79 total

On a 2017 iMac (3,4 GHz Quad-Core Intel Core i5):

207,83s user 27,46s system 55% cpu 7:06,18 total

bradleystachurski commented 1 year ago

Out of curiosity, is this roughly what you're seeing for build times?

root@eaeb68a17691:~/nado-book# time ./make_book.sh --paperback

real    3m4.038s
user    2m59.142s
sys     0m13.953s

For reference, I'm not on a particularly beefy machine.

root@eaeb68a17691:~/nado-book# lscpu
Architecture:        x86_64
CPU(s):              4
Model name:          Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz
Sjors commented 1 year ago

Yes, 3 to 7 minutes depending on the machine. Added some stats to the description.

It's especially annoying when I'm making smaller changes. Perhaps it can be parallelised, so that it only rebuilds the chapter I touched? It might also help to replace the current bash script with a makefile, which should avoid some duplicate work on the figures.