I started using pygment for my site and just for about 15 pages, it is taking 3 seconds to build every time I restart my computer. It does seem to be much quicker (100-200ms) for subsequent small changes.
But I read bout pygment is slow as you have more pages and I explored highlight.js and prism.js.
For highlight.js, well, I am not sure if it is working completely right as expected. Much less code are highlighted comparing to pygment.
I have the same article with highlight js:
The theme source code is available here: https://github.com/JesseZhuang/hugo-material-blog
I adapted @digitalcraftsman’s material doc theme and fixed some code background in the css file for dark syntax highlighting.