Reduce the size of compiler byte arrays

Issue #7 resolved
Sean Kauffman repo owner created an issue

The compiler works partly by including source code for nfer in byte arrays that it can then write as part of the output. This is simple, for the most part, but it results in bloat of the main executable. Try to figure out how to reduce the size of the byte arrays.

One idea would be to put the files together into a single file first, then to compress it using something like zlib. Ideally, compression and decompression would be done with simple, internal code and not introduce any external dependencies. The time taken to write the compiler file is not a concern.

Comments (3)

  1. Sean Kauffman reporter
    • changed status to open

    I discovered a nifty little compression/decompression routine called "Ross Data Compression": http://collaboration.cmc.ec.gc.ca/science/rpn/biblio/ddj/Website/articles/CUJ/1992/9210/ross/ross.htm

    Dude wrote it for a magazine back in 1992. It is exactly what I was looking for in that it is very brief, simple code. The compression is not terrible, actually. Not great, either, but it helps. I might play around with the algorithm and see if I can increase the compression for my workload without changing much.

  2. Sean Kauffman reporter

    The included code is now preprocessed and compressed using custom code based on Ross Data Compression. Simple routines overall.

  3. Log in to comment