MarkBind / markbind

MarkBind is a tool for generating content-heavy websites from source files in Markdown format
https://markbind.org/
MIT License
135 stars 124 forks source link

Refactor to improve the efficiency of markbind with parallelism #2503

Open yiwen101 opened 6 months ago

yiwen101 commented 6 months ago

Some of the current code can benefit from parallelism. Eg:

Screenshot 2024-04-06 at 10 28 35

Another issue of this way of writing is, we do not have a clear idea on the dependency of the sequence of run.

In future, we should run every no conflicting async function in parallel, and shift to A.then().then() style to specify sequential dependencies.

tlylt commented 2 months ago

PRs that address this issue should be careful with the potential unintended impacts on functionality. I believe some functions have (undesirable) implicit dependencies and introducing concurrent execution could lead to subtle bugs. The prereq for tackling this is therefore to come up with a clear flow diagram describing the various operations.

Since this is about performance, another thing to ensure is to capture the before and after timing, as well as CPU/memory consumption to assess the impact.