Benchmarking, some comments #1907
alerque
started this conversation in
Show and tell
Replies: 1 comment 2 replies
-
I want to know how this project considers performance. If performance is particularly important, it may be possible to speed things up by replacing the Lua C API library with a C library that uses FFI. Moreover, would you like to share benchmark results on longer documents, for example a research paper of 20 pages length. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been fiddling around with some benchmarks and reached some surprising conclusions.
LuaJIT is just far and away faster than PUC Lua so I haven't even bothered with PUC much lately.
SILE's startup time to render a simple document is 3-4× faster that Typst. I did not expect that. Typst beats the pants off us for longer documents and their incremental compile is brilliant compared to what we are doing, but we can generate 3 PDF files to their one just on startup, render some text, write a PDF, shut down.
The plain Lua versions of SILE startup faster than the Rust builds. For
hello world
documents with no packages this is 40% faster. For longer documents the difference quickly falls to 10% (i.e. 100 pages of lorem text). For complex documents in real life (i.e. the manual) the difference is more like 3%. I'm guessed this was because I was testing a Rust binary that had all the C modules and Lua modules for every core package embeded. This guess turned out to be wrong, because a Rust binary with no embeding and dynamic linking was slower than the static build with all the Lua assets embeded.Both plain Lua and Rust versions use almost exactly the same RAM (70-90MB depending and document length) and 100% of one CPU core. The Rust encapsulated version gives us a lot more possible jumping off points for parallelization, especially since we can do things like clone the VM, restore a previous state, etc.
Beta Was this translation helpful? Give feedback.
All reactions