-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lua 5.1 compatibility #70
Conversation
Luacheck CI update from Omikhleia/markdown.sile#101 yields:
Yet they seem to be ok:
|
Not seeing any noticeable performance improvement, so this With |
This language is insane. |
See related commits in Omikhleia/markdown.sile#101 Co-authored-by: Caleb Maclennan <caleb@alerque.com>
0dfbb40
to
5fe8a2a
Compare
Not a fix as those exist in Lua 5.1 to 5.4 at the time of writing, but were marked deprecated in 5.2 and 5.3...
5fe8a2a
to
e8d0bb2
Compare
Yes, math in Lua is kind of insane. You haven't even scratched the surface of weirdness when you get into 32 bit vs. 64 bit numbers, bit-shift operators, etc. There isn't a clear succession of VMs because multiple parties that don't agree have continued developing the language in several directions. For $ for LUA in lua5.4 lua5.1 luajit; do $LUA -e 'print(math.log10(5))'; done
0.69897000433602
0.69897000433602
0.69897000433602
$ for LUA in lua5.4 lua5.1 luajit; do $LUA -e 'print(math.log(5)/math.log(10))'; done
0.69897000433602
0.69897000433602
0.69897000433602 |
Between Lua 5.4 and LuaJIT? I've benchmarked the difference hundreds of times over the last couple years and LuaJIT is always consistently way faster. And not just 5% or 10% faster but 200–250%. On the system I happen to be on right now with SILE master (not develop), the difference in rendering the SILE manual is 37.5s for Lua 5.4 vs. 18.9s for LuaJIT (or 16.2s for the OpenResty fork of LuaJIT). That's a bit over twice as fast. The startup time for both is about the same so the difference on a one page document won't be huge, but the longer documents get the more obvious the difference should be. |
The |
Thanks.
I'll do some perf comparisons after a clean reboot. |
SILE requires and provides the compat53 patches. That should allow |
On a second thought, we don't want troubles later, so let's also enforce our vendored content is checked.
On a second thought, we'll want to avoid troubles later, so will enforce linting on vendored libraries, and ideally propose fixes upstream EDIT: Acceptable warnings ignored in tinyyaml + opportunity to include a bug fix. |
Synchronized tinyyaml vendored copy with api7's v0.4.4
09a2208
to
bc3f04f
Compare
Naive black-box performances - Let's go biblical. So let's take a big file, compiling the Segond Bible... Lua 5.4 (custom made image, built some time ago with my rocks already installed, and a few extra fonts we are not going to use anyway)
LuaJIT 2.1 (made as stated above)
Of course this is not a general test -- but on these two runs on big XML files with collated notes and references,
Indeed better (x 1.56 boost). |
At some point though (near page 1200), underfull/overfull message start to differ... |
Actually started much earlier. At some points, likely chapters (= bible books, on a new page) it gets in sync, and the sequences repeat. Could be that I don't have the exact same version of Gentium Plus in both images. It's a problem for having reproducible output for a given book (and anything > 1pt starts getting embarrassing), but I am not going to care here for now: this is acceptable for a pre-alpha software. |
It would be pretty easy to check whether the difference is the font, the SILE version (you are pitting v0.14.11 against v0.14.13 here) or the Lua version. I very much suspect the SILE version is the culprit, with a second guess being the font version difference. I have yet to run into anything at all that successfully runs without errors but gives different metrics between Lua versions. I don't know what math you're doing in libraries apart from what SILE does, but I'm pretty confident SILE's math isn't being thrown off. I have a lot of tooling for comparing builds done with various different options like different Lua versions or SILE versions, but I don't have your input content or font version to compare with. |
Yep, the test is not perfect (a 0.11 + cherry-picked patches that make it close to 0.13 but not so, vs. a real 0.13, both built at different times so maybe no getting the exact same font and tooling, etc.) -- Most important I guess is the perf. boost, which I assume to be somehow "correct" and cool. The rest would need a better testing procedure, admittedly! |
Note for future investigation: the "end" sequence might be easier to extract than things that occurs in the middle of books: Everything was again in sync until Revelations, so it could be interesting to process just these few books EDIT: they were in sync since |
Merging so I can start fetching dev luarocks and do some more tests. |
For the record:
|
Closes #71
Stage 1:
Stage 2:
Since we are heading toward a release, consider finalizing the minor PR there...(postponed)Stage 3 (release smoke tests)