Top all-time · #2607
sillycross.github.io
Personal blog · sillycross.github.ioprogrammingsystems
sillycross.github.io is a personal blog at sillycross.github.io about programming and systems. Since 2021, 32 different Hacker News readers have linked it 41 times, most often “Building a baseline JIT for Lua automatically (2023)”. The last post was in 2023, but the archive is still widely read.
Most-linked posts?
- Building a baseline JIT for Lua automatically (2023)13 people · 14 mentions · first linked 2023-05-12
- Building the fastest Lua interpreter automatically8 people · 8 mentions · first linked 2022-11-22
- A Trick for Reflection in C++3 people · 3 mentions · first linked 2021-08-24
- Debugging a Bit-Flip Error2 people · 2 mentions · first linked 2023-09-29
- Building the fastest Lua interpreter.. automatically2 people · 2 mentions · first linked 2022-11-22
- Microbenchmarking is hard: how an innocent printf caused a drastic slowdown2 people · 2 mentions · first linked 2021-08-10
- Bizarre performance characteristics of Alder Lake CPUs2 people · 2 mentions · first linked 2022-11-23
What Hacker News says?
I think it's really cool that Haoran Xu and Fredrik Kjolstad's copy-and-patch technique[0] is catching on, I remember discovering it through Xu's blog posts about his LuaJIT remake project[1][2], where he intends to apply these techniques to Lua (and I probably found those through a post here). I was just blown away by how they "recycled" all these battle-tested techniques and technologies, and used it to synthesize…
Comment linking /2023/05/12/2023-05-12/
on “Python 3.13 Gets a JIT”Submitted Building the fastest Lua interpreter automatically as a story · 553 points
HN discussionI think this is unlikely for SQLite (other comments cover why it probably wouldn't happen even if it were likely to benefit), but I happened to have the copy and patch paper open in a tab, so I'll take the opportunity to share it here. https://sillycross.github.io/assets/copy-and-patch.pdf It has great potential for many applications, if not this particular one.
Comment linking /assets/copy-and-patch.pdf
on “Why SQLite Uses Bytecode”Submitted Building a baseline JIT for Lua automatically (2023) as a story · 133 points
HN discussionThe remaining issue with tail calls used to switch context, is that you’re using functions that must use a calling convention. And unfortunately they waste registers to restore state on function exit. See the luajit remake blog for an exhaustive analysis and alternative using an intermediate compiler https://sillycross.github.io/2022/11/22/2022-11-22/
Comment linking /2022/11/22/2022-11-22/
on “Parsing protobuf at 2+GB/s: how I learned to love tail calls in C (2021)”Submitted CookUnity fabricated an order with random items and charged my credit card as a story · 26 points
HN discussion> I just meant that even being aware this is a naive copy-and-patch JIT, my first impression was that the code was slightly worse than I expected. > "there’s only so much one can do without touching the data model" You probably want to look at the other link in that PR, which demonstrated how well copy-and-patch can do for another dynamic language (Lua): [1] Of course, whether or not CPython could eventually make it…
Comment linking /2023/05/12/2023-05-12/
on “A copy-and-patch JIT compiler for CPython”Submitted A Trick for Reflection in C++ as a story · 14 points
HN discussionIt's crazy that this post seems to have stumbled across an equivalent to the Copy-and-Patch technique[0] used to create a Lua interpreter faster than LuaJit[1] [0]: https://sillycross.github.io/2023/05/12/2023-05-12/ [1]: https://sillycross.github.io/2022/11/22/2022-11-22/ The major difference is that LuaJIT Remake's Copy-and-Patch requires "manually" copying blocks of assembly code and patching values, while this p…
Comment linking /2022/11/22/2022-11-22/
on “Faster interpreters in Go: Catching up with C++”Submitted Microbenchmarking is hard: how an innocent printf caused a drastic slowdown as a story · 10 points
HN discussionBlog post about the approach here: https://sillycross.github.io/2023/05/12/2023-05-12/
Comment linking /2023/05/12/2023-05-12/
on “Copy-and-Patch: Fast compilation for high-level languages and bytecode (2020)”Submitted Understanding a static analysis pass in JavaScriptCore JIT as a story · 7 points
HN discussion> We implement LuaJIT Remake (LJR), a standard-compliant Lua 5.1 VM, using Deegen. Across 44 benchmarks, LJR's interpreter is on average 179% faster than the official PUC Lua interpreter, and 31% faster than LuaJIT's interpreter. LJR's baseline JIT has negligible startup delay, and its execution performance is on average 360% faster than PUC Lua and only 33% slower (but faster on 13/44 benchmarks) than LuaJIT's opti…
Comment linking /
on “Deegen: A JIT-Capable VM Generator for Dynamic Languages”Submitted Building the fastest Lua interpreter.. automatically as a story · 4 points
HN discussion> we might conclude that the speed-up of a manual assembler implementation compared to a generated interpreter is about 30%[, t]herefore it's no longer worth the effort to implement an interpreter in assembler You got that backwards. The paper reports Deegen’s generated interpreter is faster than LuaJIT’s handwritten one by 30%. That’s actually pretty impressive—and pretty impressively straightforwardly achieved[1],…
Comment linking /2022/11/22/2022-11-22/
on “Deegen: A JIT-Capable VM Generator for Dynamic Languages”Submitted Building a baseline JIT for Lua automatically as a story · 4 points
HN discussionThe second part from 2023 ( https://sillycross.github.io/2023/05/12/2023-05-12/ ) is even more interesting, but the last commit of https://github.com/luajit-remake/luajit-remake was eight months ago, so the development seems to unfortunately have stalled. Does anyone have information about the reason?
Comment linking /2023/05/12/2023-05-12/
on “Building the fastest Lua interpreter.. automatically (2022)”Submitted Building the fastest Lua interpreter.. automatically (2022) as a story · 3 points
HN discussionIt doesn't make sense to me that an embedded VM/interpreter could ever outperform direct code You're adding a layer of abstraction and indirection, so how is it possible that a more indirect solution can have better performance? This seems counterintuitive, so I googled it. Apparently, it boils down to instruction cache efficiency and branch prediction, largely. The best content I could find was this post, as well a…
Comment linking /2022/11/22/2022-11-22/
on “A tail-call interpreter in (nightly) Rust”Submitted Building a baseline JIT for Lua automatically as a story · 2 points
HN discussionSomeone needs to learn to use copy / paste properly LOL! Take a look at the URL: https://sillycross.github.io/2021/08/23/https://sillycross.g... Here's the actual link: https://sillycross.github.io/2021/08/23/2021-08-23/
Comment linking /2021/08/23/2021-08-23/
on “A Trick for Reflection in C++”Submitted Bizarre performance characteristics of Alder Lake CPUs as a story · 2 points
HN discussionSubmitted How Hard It Is to Get a Microbenchmark Done Right as a story · 2 points
HN discussionSubmitted Building a baseline JIT for Lua automatically as a story · 1 points
HN discussionSubmitted Building the fastest Lua interpreter.. automatically (2022) as a story · 1 points
HN discussionSubmitted Debugging a Bit-Flip Error as a story · 1 points
HN discussionSubmitted Building a baseline JIT for Lua automatically as a story · 1 points
HN discussionSubmitted Building a baseline JIT for Lua automatically as a story · 1 points
HN discussionSubmitted Debugging a Bit-Flip Error as a story · 1 points
HN discussionSubmitted Building a baseline JIT for Lua automatically as a story · 1 points
HN discussion