Skip to content
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

Revisit compression #16

Open
tkittel opened this issue Mar 29, 2017 · 0 comments
Open

Revisit compression #16

tkittel opened this issue Mar 29, 2017 · 0 comments

Comments

@tkittel
Copy link
Member

tkittel commented Mar 29, 2017

We currently support compression or not simply by having gzip (external or internal) changing the files from .mcpl to .mcpl.gz and back. This was done prior to having provided mcpl_fat.c, in order to help mcstas/mcxtrace which did not link against zlib, and to avoid one extra dependency in general. It does provide some hassle for hook and script-writers, to figure out the final name of the output file.

However, given the existence of mcpl_fat.c it might not be so bad to simply assume zlib support everywhere. Thus, we could consider having internal compression and avoid dealing with .mcpl.gz at all.

If so, we might even consider compression in blocks of (say) 1000 particles at a time, or to otherwise use gzip blocks, in order to support more efficient backwards seeking or forward skips, which otherwise implies re-decompression of the entire amount of data before the target point.

The issue with that is of course that it makes particle lengths non-constant, introducing its own issues, as well as complicating the format.

Alternatively, we can investigate if perhaps a bit of custom compression (such as organising each block of 1024 particles in columns and using a custom run-length-encoding) would allow us to do away with zlib altogether. That would probably cost a bit of compression efficiency, but perhaps not too much.

This issue is clearly not for the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant