Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Also calculate blocks lazily #1830
Hey, psst, buddy, would you like to see some really weird code? Then boy do I have the PR for you.
Following on from #1828 where we calculated
Unfortunately the big differences between
So this does uh something else. The basic idea is that we can create a collection that only looks like a list of blocks but actually only stores the endpoints until we first ask it for each block object.
Builds on top of #1826, so earlier commits are from that PR.
I tried this briefly, and (predictably) it was not as easy as I thought. I still think it's possible in principle, but it needs more setup than I'm willing to do at the moment, so don't worry about it.
Yeah this is about where I got to.
ETA: Also I think that even if we didn't need them during generation time this would probably still be a win because of the reduced storage requirements - many block usages don't actually need the whole list. I'm actually wondering about making
Feb 28, 2019
After some more poking around, I confirmed that there's only one genuine attempt to obtain a
If I find a way to turn this knowledge into a useful simplification of
I guess we could just always write the length of the last block generated to the