3 ms·
> About what findings, sorry? These findings: The important bit is removing object allocating, removing boxing, deep inlining, and specialisation... when you'v
by Rochus 6y ago
> About what findings, sorry?
These findings: The important bit is removing object allocating, removing boxing, deep inlining, and specialisation... when you've done all that work the exact registers and instructions don't seem to really make a huge difference.
> Linear Scan is an example I reach for when I talk about what parts of the compiler are really important
Sure, but you just said that register allocation is not a relevant factor compared to other achievements when using Gral VM. Or did I get that wrong?
- chrisseaton 6y ago> These findings: Right - didn't I cover those? I gave the example that Graal is extremely powerful with a huge amount of money and effort behind it, but doesn't really bother at all with serious register allocation or clever instruction selection as suggested you should in text books. It uses the most basic algorithm and doesn't see any need to do any more, even when they're still keen on tiny improvements to the output. It just doesn't seem to be worth it. But it does put a lot of effort into object allocation, boxing, inlining, specialisation, etc. So those seem in practice to be worth it.
- Rochus 6y ago> But it does put a lot of effort into object allocation, boxing, inlining, specialisation, etc. So those seem in practice to be worth it. Well, as I understand this is an assumption, not the result of a dedicated study. I made similar observations when using LuaJIT as a SOM backend (see https://github.com/rochus-keller/Som https://github.com/rochus-keller/Som), but it's not clear why the Gral based SOM implementations are that much faster.
- chrisseaton 6y ago> Well, as I understand this is an assumption, not the result of a dedicated study. I'm not sure what you're angling for? Some kind of falsifiable proof about where it makes sense to put engineering effort and complexity? You're not going to find that sorry nobody's ever been able to seriously quantify those kind of things. > I made similar observations Well then why are we arguing about it if it's apparent to both of us?
- Rochus 6y ago> I'm not sure what you're angling for? You assume that The important bit is removing object allocating, removing boxing, deep inlining, and specialisation... when you've done all that work the exact registers and instructions don't seem to really make a huge difference. But it would be very interesting to have something like a scientific study about why Gral is indeed faster than other approaches. > Well then why are we arguing about it if it's apparent to both of us? Because I would like to understand the true reason to be able to improve my implementation (if feasible). EDIT: as you claim textbooks about compiler design are wrong or not up to date, so my desire to have someone change that seems understandable, isn't it?
- chrisseaton 6y agoI don't think it's correct to say I'm just assuming. Linear Scan produces a program with apparently less efficient register allocation. In practice, it does not matter for the wider performance of the code. Is this not evidence to support the assumption that sophisticated register allocation does not matter as much as we thought? When you enable Graal's more sophisticated escape analysis algorithms you get real-world speed ups in workloads such as Twitter, worth hundreds of thousands of dollars in costs saved. Is this not evidence to support the assumption that sophisticated escape analysis algorithms do matter? The first is a formal scientific study. The second is not but it's still a very large-scale empirical result measured by an expert. They aren't falsifiable but as I said I don't think that's a realistic expectation, and I think these are enough for it to be more than an assumption.
- Rochus 6y ago> Is this not evidence to support the assumption that sophisticated register allocation does not matter as much as we thought? It's an indication but it doesn't sufficiently support the conclusion. There are so many other things to consider. > Is this not evidence to support the assumption that sophisticated escape analysis algorithms do matter? Would you as a scientist seriously accept this as a sufficient evidence for your claims? But let's leave it at that for the moment. As far as I know there are ongoing research projects which could deliver more insights why specifically a Smalltalk VM runs faster on Gral than anywhere else.