diff options
author | Colin Walters <walters@verbum.org> | 2017-02-07 08:59:32 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2017-02-07 17:01:09 +0000 |
commit | 3d38f03e4fd4cc20f754bb787feb0d109387f4f8 (patch) | |
tree | 2a98195cd399914739f85d66e2fee09ba0228a44 /src/libostree/ostree-core-private.h | |
parent | 9169268c31df31cc09495e2a04c30cd251f22b5d (diff) | |
download | ostree-3d38f03e4fd4cc20f754bb787feb0d109387f4f8.tar.gz |
repo: Add archive/zlib-level option, drop default compression to 6
The gzip default is 6. When I was writing this code, I chose 9 under
the assumption that for long-term archival, the extra compression was
worth it.
Turns out level 9 is really, really not worth it. Here's run at level 9
compressing the current Fedora Atomic Host into archive:
```
ostree --repo=repo pull-local repo-build fedora-atomic/25/x86_64/docker-host
real 2m38.115s
user 2m31.210s
sys 0m3.114s
617M repo
```
And here's the new default level of 6:
```
ostree --repo=repo pull-local repo-build fedora-atomic/25/x86_64/docker-host
real 0m53.712s
user 0m43.727s
sys 0m3.601s
619M repo
619M total
```
As you can see, we run almost *three times* faster, and we take up *less
than one percent* more space.
Conclusion: Using level 9 is dumb. And here's a run at compression level 1:
```
ostree --repo=repo pull-local repo-build fedora-atomic/25/x86_64/docker-host
real 0m24.073s
user 0m17.574s
sys 0m2.636s
643M repo
643M total
```
I would argue actually many people would prefer even this for "devel" repos.
For production repos, you want static deltas anyways. (However, perhaps
we should support a model where generating a delta involves re-compressing
fallback objects with a bit stronger compression level).
Anyways, let's make everyone's life better and switch the default to 6.
Closes: #671
Approved by: jlebon
Diffstat (limited to 'src/libostree/ostree-core-private.h')
-rw-r--r-- | src/libostree/ostree-core-private.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libostree/ostree-core-private.h b/src/libostree/ostree-core-private.h index 0c5fb0eb..cfd8a998 100644 --- a/src/libostree/ostree-core-private.h +++ b/src/libostree/ostree-core-private.h @@ -24,6 +24,9 @@ G_BEGIN_DECLS +/* It's what gzip does, 9 is too slow */ +#define OSTREE_ARCHIVE_DEFAULT_COMPRESSION_LEVEL (6) + /* This file contains private implementation data format definitions * read by multiple implementation .c files. */ @@ -143,4 +146,16 @@ _ostree_detached_metadata_append_gpg_sig (GVariant *existing_metadata, GFile * _ostree_get_default_sysroot_path (void); +_OSTREE_PUBLIC +gboolean +_ostree_raw_file_to_archive_stream (GInputStream *input, + GFileInfo *file_info, + GVariant *xattrs, + guint compression_level, + GInputStream **out_input, + GCancellable *cancellable, + GError **error); + + + G_END_DECLS |