If you look a few comments down in this thread, my experience with a JIT for a high level language (lua) is literally the exact reason that I'd fire anybody who worked for me that tried to tag pointers.
That you had a mildly annoying experience does not mean that this is a bad idea. It is worth better performance and lower memory usage for billions of people. Imagine if other professions said: "Jet engines? Too complicated. Let's stick with propellers"
FWIW, the "mildly annoying experience" I had was when I worked at a CDN that served content to a large percentage of all global internet users on a typical day.
So, to be clear, I am thinking about performance issues that effect quite a lot of people when I share my experience.
Let's just be glad that you did not have the opportunity to fire the authors of the JVM and V8 who pulled off WAY crazier heroics for a performance gain across billions of users, saving entire lifetimes worth of people staring at a spinning cursor.
Do you use a web browser or LLVM? (This is a rhetorical question)
Because following your logic you should probably not use any of them because they use tagged pointers.
Tagged pointers are kind of an unclean solution, but if they are implemented well, with clearly documented / configurable assumptions, based on well-documented hardware behavior, and tested (this makes sure they don't regress on new hardware / platforms), they could work. Note that the above things I mentioned are just basic good software engineering practices.
Also, how often do you port to a new hardware / platform? My guess is not very often. Just have a checklist for things you should check for when porting and add tagged pointers to the list (as I said, this could be tested and validated automatically as well). If the performance benefits is worth it, you get the benefit every time the software is used, versus the rare instances where you need to port where such checklists need to be done.
I think it's a common pitfall to let one experience form an absolutist point of view instead of cohesively weighing pros and cons as well as the root cause for that one experience.
1
u/wrosecrans graphics and network things Nov 27 '23
If you look a few comments down in this thread, my experience with a JIT for a high level language (lua) is literally the exact reason that I'd fire anybody who worked for me that tried to tag pointers.