Syntax highlighting not as expected prism.js and highlight.js

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 prism.js the css theme is working but the javascript highlighting part does not work at all for java code, a weird bug.

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:

and pygment:

I am wondering whether the highlight js/prism js javascript is conflicting with the theme javascript or css?

The theme source code is available here:

I adapted @digitalcraftsman’s material doc theme and fixed some code background in the css file for dark syntax highlighting.