Commit graph

122 commits

Author SHA1 Message Date
Con Kolivas f422e93232 Update benchmarks.
Minor tweaks to output.
2010-11-05 00:16:18 +11:00
Con Kolivas 29b166629a Huge rewrite of buffer reading in rzip.c. We use a wrapper instead of
accessing the buffer directly, thus allowing us to have window sizes larger than
available ram. This is implemented through the use of a "sliding mmap"
implementation. Sliding mmap uses two mmapped buffers, one large one as
previously, and one page sized smaller one. When an attempt is made to read
beyond the end of the large buffer, the small buffer is remapped to the file
area that's being accessed. While this implementation is 100x slower than direct
mmapping, it allows us to implement unlimited sized compression windows.
Implement the -U option with unlimited sized windows.
Rework the selection of compression windows. Instead of trying to guess how
much ram the machine might be able to access, we try to safely buffer as much
ram as we can, and then use that to determine the file buffer size. Do not
choose an arbitrary upper window limit unless -w is specified.
Rework the -M option to try to buffer the entire file, reducing the buffer
size until we succeed.
Align buffer sizes to page size.
Clean up lots of unneeded variables.
Fix lots of minor logic issues to do with window sizes accepted/passed to rzip
and the compression backends.
More error handling.
Change -L to affect rzip compression level directly as well as backend
compression level and use 9 by default now.
More cleanups of information output.
Use 3 point release numbering in case one minor version has many subversions.
Numerous minor cleanups and tidying.
Updated docs and manpages.
2010-11-04 21:14:55 +11:00
Con Kolivas 9c00229ee1 Fix fd_hist check occurring too early on decompress.
fsync after flushing buffer.
Remove unnecessary memset after anonymous mmap.
Do test malloc before compression backend to see how big a chunk can be passed.
2010-11-02 13:50:15 +11:00
Con Kolivas c0ac813f6d Update docs.
Bump version number.
Tidy.
2010-11-02 11:14:00 +11:00
Con Kolivas 102140dc2b Reinstate the temporary files for decompression to stdout and testing as the damaged line reinstated last commit meant it looked like those combinations worked when they actually didn't.
Compression from stdin still works without temporary files.
2010-11-02 10:52:21 +11:00
Con Kolivas 772fbf602e Reinstitute 2GB window limit on 32 bit. It still doesn't work. However we can now decompress larger windows.
Do more mmap in place of malloc.
Update docs.
Remove redundant code.
2010-11-01 22:55:59 +11:00
Con Kolivas 0e09c9ec24 Reinstate the temporary file for decompression from stdin. Seeking makes that option broken without the temporary file.
Start documenting the new features in this version.
Minor tidying.
2010-11-01 21:37:55 +11:00
Con Kolivas ba1bf30d78 Minor tidying. 2010-11-01 19:59:27 +11:00
Con Kolivas 232b268367 Fix file size recording in the magic header when stdin is used. 2010-11-01 19:18:20 +11:00
Con Kolivas 43dd72b9e1 Do real stdin without the stupid temporary files by mmapping into anonymous ram. 2010-11-01 16:45:48 +11:00
Con Kolivas cb27097cb4 A few more cleanups to avoid using temporary files for stdout and testing on decompression. 2010-11-01 12:50:20 +11:00
Con Kolivas 3a22eb09b3 Fix output to work correctly to screen when stdout is selected.
Make stdout write directly to stdout on decompression without the need for temporary files since there is no need to seek backwards.
Make file testing not actually write the file during test.
More tidying up.
2010-11-01 11:18:58 +11:00
Con Kolivas a9ad1aef0e Start cleaning up all the flag testing with neat macros. 2010-11-01 04:53:53 +11:00
Con Kolivas 2bacbc60d2 We were attempting to truncate mmap to page size when only the offset needed to be.
Fix the longstanding limit on 32 bits that allowed us to allocate only 2GB of ram by moving the big malloc calls to mmap equivalents which allow us to mmap up to 2^44 bytes of anonymous space.
Use progressively smaller preallocation to try and defragment ram prior to real mmap call to increase success rate of allocating ram when it's a significant proportion of total ram.
Don't fail if preallocation is unsuccessful.
Add more detailed error reporting.
Minor cleanups.
2010-11-01 00:19:39 +11:00
Con Kolivas 25705aec28 Minor tidying. 2010-10-31 15:17:04 +11:00
Con Kolivas 8d9b64e1ec Change byte width to be dependant on file size.
This will increase speed of compression and generate a smaller file, but not be backward compatible.
Tweak the way memory is allocated to optimise chances of success and minimise slowdown for the machine.
fsync to empty dirty data before allocating large ram to increase chance of mem allocation and decrease disk thrash of write vs read.
Add lots more information to verbose mode.
Lots of code tidying and minor tweaks.
2010-10-31 15:09:05 +11:00
Con Kolivas de262bad2a Revert "Put tempfiles in /tmp rather than current directory."
This reverts commit 603785f783.

Not everyone has a large /tmp directory and may not be able to fit the temporary files in /tmp so it's not a great idea to do this by default.
2010-05-22 09:10:25 +10:00
Ed Avis b4dd8cdaa1 Also suppress final [OK] message with -q flag. 2010-05-21 15:40:33 +01:00
Ed Avis 603785f783 Put tempfiles in /tmp rather than current directory. 2010-05-19 14:35:39 +01:00
Ed Avis 025b4507c9 mkstemp returns -1 on failure. 2010-05-19 14:31:11 +01:00
Con Kolivas d972496aa8 Make messages come via stdout instead of stderror courtesy of Alexander Saprykin 2010-04-25 16:26:00 +10:00
Con Kolivas 6dcceb0b1b Initial import 2010-03-29 10:07:08 +11:00