-
I tried to build a fairly large site (+20K mdx files, 1.1 GB), and after about 30 minutes it looked like stuck:
Memory consumption was huge, the system entered swap and became less responsive (my Mac has 32 GB RAM). The system is not dead, since in the Activity Monitor I see the process still 100% active, just that the progress bar is stuck. The site is the LLVM reference, generated as MDX from Doxygen XML output. I enabled faster via:
I also increased the node process heap and stack, otherwise it crashed much earlier. This was just a test, I admit that an extreme one, to see how the But we'll probably not be able to see the result, the site seems too large for Docusaurus to render. (I killed the stuck build after 45 minutes). |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 18 replies
-
We have another site with 20k+ docs and it builds fine but there's an algo that doesn't scale well within Rspack. If it doesn't work, this would be helpful to create a repro so that I can report a bug to the Rspack team. It should work and be able to bundle such app in less than 5 minutes on a decent computer. |
Beta Was this translation helpful? Give feedback.
-
I re-created the test and documented the process. A large Git repo with the test is available at: |
Beta Was this translation helpful? Give feedback.
-
One more note: the purpose of this test was to check how the docusaurus-plugin-doxygen behaves on large sites, not Docusaurus itself. I don't have any information about the LLVM team considering using Docusaurus for their site, and I doubt that the plugin will be used in such a configuration. However, in order to improve the plugin, it would be useful for me to see how Docusaurus renders the generated MDX files. Not to mention that fixing Docusaurus to use less memory would be beneficial for other large projects too. |
Beta Was this translation helpful? Give feedback.
-
I fixed the two errors you mentioned (by adding empty lines) and pushed a new version of the mdx files. |
Beta Was this translation helpful? Give feedback.
-
So after investigating, it seems that the problem is not really the number of files, but their complexity. You have many very large MDX files with complex content to parse with MDX. find . -type f -print0 | xargs -0 du -h | sort -rh | head -n 100
29M ./index/classes/all.mdx
21M ./index/classes/functions.mdx
16M ./files/lib-lib-target-lib-target-x86-x86isellowering-cpp.mdx
8.1M ./files/lib-lib-target-lib-target-aarch64-aarch64isellowering-cpp.mdx
7.7M ./files/lib-lib-codegen-lib-codegen-selectiondag-dagcombiner-cpp.mdx
7.6M ./namespaces/llvm.mdx
6.1M ./files/lib-lib-target-lib-target-riscv-riscvisellowering-cpp.mdx
6.0M ./index/classes/variables.mdx
6.0M ./files/lib-lib-target-lib-target-arm-armisellowering-cpp.mdx
5.2M ./files/lib-lib-transforms-lib-transforms-vectorize-slpvectorizer-cpp.mdx
4.9M ./files/lib-lib-target-lib-target-powerpc-ppcisellowering-cpp.mdx
4.4M ./files/lib-lib-target-lib-target-amdgpu-siisellowering-cpp.mdx
4.1M ./files/lib-lib-analysis-scalarevolution-cpp.mdx
3.6M ./files/lib-lib-transforms-lib-transforms-ipo-attributorattributes-cpp.mdx
3.6M ./files/lib-lib-support-unicodenametocodepointgenerated-cpp.mdx
3.6M ./files/lib-lib-codegen-lib-codegen-selectiondag-selectiondag-cpp.mdx
3.5M ./files/lib-lib-target-lib-target-arm-lib-target-arm-asmparser-armasmparser-cpp.mdx
3.3M ./files/lib-lib-codegen-lib-codegen-selectiondag-selectiondagbuilder-cpp.mdx
3.2M ./files/lib-lib-codegen-lib-codegen-selectiondag-targetlowering-cpp.mdx
2.8M ./files/lib-lib-target-lib-target-systemz-systemzisellowering-cpp.mdx
2.7M ./files/lib-lib-transforms-lib-transforms-vectorize-loopvectorize-cpp.mdx
2.7M ./files/lib-lib-analysis-valuetracking-cpp.mdx
2.6M ./files/lib-lib-asmparser-llparser-cpp.mdx
2.6M ./classes/index.mdx
2.5M ./files/lib-lib-target-lib-target-x86-x86instrinfo-cpp.mdx
2.5M ./files/lib-lib-target-lib-target-amdgpu-siinstrinfo-cpp.mdx
2.5M ./files/lib-lib-target-lib-target-amdgpu-lib-target-amdgpu-asmparser-amdgpuasmparser-cpp.mdx
2.5M ./files/lib-lib-target-lib-target-aarch64-aarch64instrinfo-cpp.mdx
2.4M ./files/lib-lib-codegen-lib-codegen-globalisel-legalizerhelper-cpp.mdx
2.3M ./files/lib-lib-transforms-lib-transforms-instcombine-instcombinecompares-cpp.mdx
2.3M ./files/lib-lib-frontend-lib-frontend-openmp-ompirbuilder-cpp.mdx
2.2M ./files/lib-lib-target-lib-target-aarch64-lib-target-aarch64-asmparser-aarch64asmparser-cpp.mdx
2.2M ./files/lib-lib-codegen-codegenprepare-cpp.mdx
2.1M ./files/lib-lib-transforms-lib-transforms-utils-simplifycfg-cpp.mdx
2.1M ./files/lib-lib-target-lib-target-mips-lib-target-mips-asmparser-mipsasmparser-cpp.mdx
2.1M ./files/lib-lib-target-lib-target-arm-lib-target-arm-disassembler-armdisassembler-cpp.mdx
2.1M ./files/lib-lib-bitcode-lib-bitcode-reader-bitcodereader-cpp.mdx
2.1M ./files/lib-lib-analysis-instructionsimplify-cpp.mdx
2.0M ./files/lib-lib-target-lib-target-aarch64-lib-target-aarch64-gisel-aarch64instructionselector-cpp.mdx
2.0M ./files/lib-lib-codegen-lib-codegen-selectiondag-legalizevectortypes-cpp.mdx
2.0M ./files/lib-lib-codegen-lib-codegen-globalisel-combinerhelper-cpp.mdx
1.9M ./files/lib-lib-target-lib-target-x86-x86targettransforminfo-cpp.mdx
1.9M ./files/lib-lib-target-lib-target-powerpc-ppciseldagtodag-cpp.mdx
1.9M ./files/lib-lib-target-lib-target-amdgpu-amdgpulegalizerinfo-cpp.mdx
1.9M ./files/lib-lib-target-lib-target-aarch64-aarch64iseldagtodag-cpp.mdx
1.9M ./files/lib-lib-ir-verifier-cpp.mdx
1.8M ./files/lib-lib-transforms-lib-transforms-scalar-loopstrengthreduce-cpp.mdx
1.8M ./files/lib-lib-transforms-lib-transforms-instrumentation-memorysanitizer-cpp.mdx
1.8M ./files/lib-lib-target-lib-target-loongarch-loongarchisellowering-cpp.mdx
1.8M ./files/lib-lib-mc-lib-mc-mcparser-masmparser-cpp.mdx
1.7M ./index/classes/classes.mdx
1.7M ./files/lib-lib-target-lib-target-arm-armbaseinstrinfo-cpp.mdx
1.7M ./files/lib-lib-codegen-lib-codegen-selectiondag-legalizeintegertypes-cpp.mdx
1.7M ./files/include-include-llvm-include-llvm-transforms-include-llvm-transforms-ipo-attributor-h.mdx
1.6M ./files/lib-lib-target-lib-target-x86-x86iseldagtodag-cpp.mdx
1.6M ./files/lib-lib-target-lib-target-powerpc-ppcperfectshuffle-h.mdx
1.6M ./files/lib-lib-target-lib-target-aarch64-aarch64perfectshuffle-h.mdx
1.6M ./files/lib-lib-ir-core-cpp.mdx
1.6M ./files/include-include-llvm-include-llvm-demangle-itaniumdemangle-h.mdx
1.5M ./files/lib-lib-transforms-lib-transforms-ipo-openmpopt-cpp.mdx
1.5M ./files/lib-lib-transforms-lib-transforms-instcombine-instcombineandorxor-cpp.mdx
1.5M ./files/lib-lib-target-lib-target-arm-armperfectshuffle-h.mdx
1.5M ./files/lib-lib-target-lib-target-arm-armiseldagtodag-cpp.mdx
1.5M ./files/lib-lib-target-lib-target-amdgpu-amdgpuisellowering-cpp.mdx
1.5M ./files/lib-lib-target-lib-target-amdgpu-amdgpuinstructionselector-cpp.mdx
1.5M ./files/lib-lib-target-lib-target-aarch64-aarch64framelowering-cpp.mdx
1.5M ./files/lib-lib-mc-lib-mc-mcparser-asmparser-cpp.mdx
1.5M ./files/lib-lib-ir-autoupgrade-cpp.mdx
1.5M ./files/lib-lib-bitcode-lib-bitcode-writer-bitcodewriter-cpp.mdx
1.4M ./files/lib-lib-transforms-lib-transforms-scalar-sroa-cpp.mdx
1.4M ./files/lib-lib-transforms-lib-transforms-instcombine-instructioncombining-cpp.mdx
1.4M ./files/lib-lib-target-lib-target-powerpc-ppcinstrinfo-cpp.mdx
1.4M ./files/lib-lib-target-lib-target-nvptx-nvptxisellowering-cpp.mdx
1.4M ./files/lib-lib-target-lib-target-mips-mipsisellowering-cpp.mdx
1.4M ./files/lib-lib-target-lib-target-aarch64-aarch64targettransforminfo-cpp.mdx
1.4M ./files/lib-lib-object-machoobjectfile-cpp.mdx
1.4M ./files/lib-lib-ir-asmwriter-cpp.mdx
1.4M ./files/lib-lib-codegen-lib-codegen-selectiondag-legalizedag-cpp.mdx
1.4M ./files/include-include-llvm-include-llvm-codegen-targetlowering-h.mdx
1.3M ./files/lib-lib-target-lib-target-hexagon-hexagoninstrinfo-cpp.mdx
1.3M ./files/lib-lib-target-lib-target-amdgpu-amdgpuregisterbankinfo-cpp.mdx
1.3M ./files/index.mdx
1.3M ./files/include-include-llvm-include-llvm-ir-instructions-h.mdx
1.2M ./files/lib-lib-transforms-lib-transforms-ipo-memprofcontextdisambiguation-cpp.mdx
1.2M ./files/lib-lib-transforms-lib-transforms-instcombine-instcombinecalls-cpp.mdx
1.2M ./files/lib-lib-target-lib-target-x86-x86framelowering-cpp.mdx
1.2M ./files/lib-lib-target-lib-target-x86-lib-target-x86-asmparser-x86asmparser-cpp.mdx
1.2M ./files/lib-lib-target-lib-target-riscv-riscvinstrinfo-cpp.mdx
1.2M ./files/lib-lib-target-lib-target-aarch64-aarch64fastisel-cpp.mdx
1.2M ./files/lib-lib-support-apfloat-cpp.mdx
1.2M ./files/lib-lib-codegen-machinescheduler-cpp.mdx
1.2M ./files/lib-lib-codegen-lib-codegen-asmprinter-asmprinter-cpp.mdx
1.2M ./files/include-include-llvm-include-llvm-ir-debuginfometadata-h.mdx
1.2M ./files/include-include-llvm-c-core-h.mdx
1.1M ./files/lib-lib-transforms-lib-transforms-vectorize-vplan-h.mdx
1.1M ./files/lib-lib-transforms-lib-transforms-utils-simplifylibcalls-cpp.mdx
1.1M ./files/lib-lib-transforms-lib-transforms-utils-local-cpp.mdx
1.1M ./files/lib-lib-transforms-lib-transforms-scalar-newgvn-cpp.mdx
1.1M ./files/lib-lib-transforms-lib-transforms-instcombine-instcombineselect-cpp.mdx
1.1M ./files/lib-lib-target-lib-target-mips-mipsseisellowering-cpp.mdx On the This would be interesting to try parsing those files sequentially, outside of Docusaurus, with no bundler, to see the outcome, but I suspect it wouldn't work that well either. However, I do notice a memory spike at the end of the bundling phase when Rspack seals and emits the JS bundles. |
Beta Was this translation helpful? Give feedback.
Yes it's normal: I'm using CommonMark instead of MDX because if I don't, the bundling fail due to docs that are not valid MDX syntax. I can't fix all your bad MDX docs so it's simpler to attempt a build with the wrong parser but at least be able to bundle (because CommonMark is much less strict and won't error).