On Wednesday, 17 August 2016 20:22:56 UTC+2, Kristoffer Carlsson wrote: > > See pr 8134. I dont think you have any worse cache locality than with your > original tuple.
You are right. I just have more memory usage. The heap will in fact have better cache locality. I'll just have exp appearing in every object in the "chained" heap, rather than per chain. I was trying hard to keep memory usage down, since some of the large benchmarks we want to do will barely fit on the machine, otherwise. I looked at the PR, and it seems relevant, but I'm not sure it directly deals with this issue. The problem with immutables indeed seems to be that you can't make immutables that contain pointers stack allocated since they contain pointers. But the standard way of dealing with this is to have the GC conservatively scan the stack. Jeff seems to make this point. On the other hand, he seems to suggest that such a mechanism already exists but earlier seems to suggest that you should only stack allocate something if it doesn't contain pointers. So I'm totally confused after reading that. I suppose if the compiler is clever enough to elide the creation of tuples that are being written directly into heap allocated resources (such as arrays), then Jeff can get his way and problems such as the one I have wont occur. But I'm very sceptical that this would be a complete solution. Bill.
