Replies: 8 comments
|
Unfortunately I can not test outside of WSL2 and the Podman machine due to the installed security appliance (regular trick to bypass the security solution as always). Anyone else might want to directly test on Linux, MacOS and Windows via native shell and binary (not the combined binary). |
|
Wow, thanks for sharing! If the user+system time is much lower than elapsed time, does that imply it's IO bound? I wouldn't have expected that if you're doing 10 runs in a row (and everything should be in disk/file system caches), so I'm guessing "no"... but maybe WSL2 adds some inefficiencies. Regardless, luasmith's single-threaded, rebuild-everything-each-time design certainly isn't optimal from the standpoint of a modern, multi-core CPU. One could argue this is a downside, but it might make more sense to just call out that luasmith's intended use case is simple personal sites. |
That‘s probably the case. Microsoft also admits that at https://learn.microsoft.com/en-us/windows/wsl/compare-versions
I didn't tune any specific WSL configuration or Podman machine details, so this is the current performance ootb.
Right, but at least I see no big peeformance degradation with a huge corpus. And also I did not show the warnings from the link checker, that some of them are invalid. I could try another run with a custom build of the theme, which does not contain the link check step (https://github.com/jaredkrinke/luasmith/blob/main/themes/blog/theme.lua#L104, https://github.com/jaredkrinke/luasmith/blob/main/main.lua#L835). In fact I would make this optional / configurable. This could have some impact on the performance and is normally not needed by me. After looking shortly at the code, I see that the link check step and the other code, I can see that the code highlighting step also uses I jumped into Lua just yesterday, so I might oversee something but the code is very well readable and comprehensible and I might still be a bit sleepy (was 7 AM here when I started writing this reply and I am trying to visualize the whole logic as flowchart in my head). Another difference I see is, that for if string.sub(item.path, -5) == ".html" thenBut for I will probably dig a bit deeper and try to find some good profiler to find out which function calls take the most time (either as flame graph, icicle graph or call graph). If you have some recommendation for a profiler, please let me know (I'm coming mostly from the PHP and Node.js world and we use specific profilers - partly integrated - for both). You might want to check the readme, the read over the design links probably does not work or is meant to link to "Under the Hood". |
|
I will create a new issue regarding design proposals. |
|
I think I will have to find a different test system with Windows and without the security solution here (which makes thinks outside of WSL2 in many cases even much slower), the WSL2 performance penalty is too big. Without linkcheck it is 10 - 20 ms less for the test with 100 documents for user time + system time. Maybe others can run the benchmarks themselves on baremetal Windows systems connected to the power cord and with highest performance settings in the System options. |
I will probably experiment a bit further and document my results:
Update: optimized it in a first rough step to spawn 20 processes after splitting the 10,000 folder with Which results in ~1000 processed md files per second with 20 processes vs the ~200 processed md files per second with only one process. Without syntax highlighting and without link checking for 10,000 documents: |
|
Closing for now. Doing the benchmarks was fun and made me think about some possible improvements for bigger setups. A simple multi-process setup also may have diminishing returns, at least it does not scale that well with I/O parts (SSD, RAM, ...) involved. |
|
Moving to a discussion so people can easily find it. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I was benchmarking luasmith via Podman on Windows 11 Pro using the podman-machine-default on WSL 2 with my Surface Laptop 6 for Business (24 GiB RAM, 1 TB SSD) with a Intel Core Ultra 165H (16 cores / 22 threads) on highest performance mode connected to the power cord
Steps
python3 generate-frontmatter.pycd luasmith-100 && hyperfine -i "./luasmith blog"cd luasmith-1000 && hyperfine -i "./luasmith blog"cd luasmith-10000 && hyperfine -i "./luasmith blog"generate-frontmatter.py:
Results
first 100 md files:
first 1000 md files:
all 10000 md files:
minimum:
xychart title "time in ms per # md documents" x-axis "# of documents" [100, 1000, 10000] y-axis "time (in ms)" 100 --> 60000 bar [350, 4264, 50269]maximum:
xychart title "time in ms per # md documents" x-axis "# of documents" [100, 1000, 10000] y-axis "time (in ms)" 100 --> 60000 bar [530, 5708, 55711]per document minimum:
xychart title "time in ms per md document" x-axis "# of documents" [100, 1000, 10000] y-axis "time (in ms)" 0 --> 6 bar [3.50, 4.264, 5.0269]per document maximum:
xychart title "time in ms per md document" x-axis "# of documents" [100, 1000, 10000] y-axis "time (in ms)" 0 --> 6 bar [5.30, 5.708, 5.5711]All reactions