-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More buffers #39
More buffers #39
Conversation
@NailLegProcessorDivide if you could take a look at this I'd appreciate it :) It makes some changes that are important for calculating larger sizes of N. |
8f17f8a
to
cc4c01e
Compare
8e7e38a
to
74bbeac
Compare
is this mostly for getting ready to stream to files? I dont quite understand the LEB128 thing. |
The leb128 change makes it so that we can write a header of a predetermined length (by default, Now we can write a stream of cubes to the file while keeping a running count, and set it to the correct value at the end. Makes it so we don't have to re-write an entire file once we know the length (there is, AFAIK, no way to "shift a file to the right" without rewriting all data following it). Not having to re-write and/or re-read the entire file if we're well aware that we will eventually know how many cubes we've written is nice. To illustrate:
Now:
I'm not sure why the format uses leb128 (just a u128 or u64 would have avoided having to do it this messily), but 🤷 This could technically mess up implementations that don't have the read function implemented (correctly!) as we have it here, but there is nothing about leb128 encoding that says you can't do this (i.e. encoding a number with a fixed amount of bytes). Main motivation is that I don't want to wait 2.5 hours just to see if the file I wrote for It's especially relevant when generating new cubesets, since the whole point is that you can't keep them all in memory and there is no way to know how many there will be in advance. |
Oh and the rest is for perf improvements (unbuffered writes to disk are slow) and bug fixes. |
ok yep, I hadnt realised the length field was variable size, that is a choice given the file is unstoreable even close to a u64 of polycubes. Rest of the changes look good to me. |
ec6ba00
to
0d20878
Compare
having to re-read the whole file Put this in a const Just get rid of this limit, we can handle it without
0d20878
to
eeb6488
Compare
@bertie2 I think this is ready for merge :) I have rebased the commits to clean up the history a bit (and would prefer a non-squash this time around). I have also verified that the funky trick (ref) for getting a fixed-size header works fine with the |
600aade
to
a9f9e0c
Compare
a9f9e0c
to
a37c83c
Compare
apologies for the delay in merging this partly life has gotten in the way, partly I have become fixated on methods for distributing the work. |
That sounds cool! Would like to see that too, the way the DFS algorithm works seems to support distrubution well :) Also no worries about delays, things happen I will gladly take any response, especially as quickly as 3 days! Thanks for merging. |
Add some write buffering to the Rust version to significantly speed up write speeds, and an option to count the cubes in a file when converting stream-oriented files.
Also add a "prefill" option to the PCube header so that we can write a fixed-size header.