PataphysicalSociety / soupault

Static website generator based on HTML element tree rewriting
https://soupault.app
MIT License
378 stars 18 forks source link

Multithread page generation #57

Open linsyking opened 11 months ago

linsyking commented 11 months ago

Is it possible to generate pages by using multiple threads to speed up?

dmbaturin commented 9 months ago

Not yet, sadly. The main problem is that Lua-ML, the Lua interpreter that soupault uses, is not thread-safe, so it will need a global lock and whenever plugins are involved, worker threads will spend a lot of time waiting for their chance to run Lua code.

But maybe my idea is wrong and there are substantial gains from parallelizing the work that can be parallelized (such as loading page source files into element trees). I'll need to experiment with it.