You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Ashod Nakashian <as...@yahoo.com> on 2012/03/11 05:59:01 UTC
Compressed Pristines
Hi All,
I'm interested in the status of Compressed Pristines[1]. Is someone working on it? Where are the latest patches (a branch?). Do we need another hand to work on this feature?
[1] http://subversion.tigris.org/issues/show_bug.cgi?id=908
Thanks!
-Ash
Re: Compressed Pristines
Posted by Ashod Nakashian <as...@yahoo.com>.
----- Original Message -----
> From: Hyrum K Wright <hy...@wandisco.com>
> To: Ashod Nakashian <as...@yahoo.com>
> Cc: Philip Martin <ph...@wandisco.com>; Greg Stein <gs...@gmail.com>; "dev@subversion.apache.org" <de...@subversion.apache.org>
> Sent: Monday, March 12, 2012 5:31 PM
> Subject: Re: Compressed Pristines
>
> On Mon, Mar 12, 2012 at 7:11 AM, Ashod Nakashian
> <as...@yahoo.com> wrote:
>> ----- Original Message -----
>>
>>> From: Philip Martin <ph...@wandisco.com>
>>> To: Ashod Nakashian <as...@yahoo.com>
>>> Cc: Greg Stein <gs...@gmail.com>;
> "dev@subversion.apache.org" <de...@subversion.apache.org>
>>> Sent: Monday, March 12, 2012 2:40 PM
>>> Subject: Re: Compressed Pristines
>>>
>>> Ashod Nakashian <as...@yahoo.com> writes:
>>>
>>>> * Are there any documentation/design/discussions on this feature
> that
>>>> I could study?
>>>
>>> There has been some discussion in the past on the dev list. I
> don't
>>> think it is written down anywhere else.
>>>
>>>> * Who should coordinate and be contacted on decision points?
>>>
>>> The dev list.
>>>
>>>> * I know this feature was planned for 1.8. Is that still
> reasonable?
>>>> (I can't find a release date for 1.8) Will 1.8 wait for this
> or has
>>>> this feature been demoted to a low-priority in general? The reason
> I
>>>> ask is to have a vague idea as to how close this feature is on the
>>>> critical path to future releases.
>>>
>>> We don't plan like that. The features that will go into 1.8 are
> the
>>> features people choose to write.
>>
>> Got it. Thanks.
>>
>> Here is my plan. I'll study whatever discussion took place on dev-list.
> My main technical concern is related to any complications that aren't
> obvious (due to design or requirements elsewhere in svn). I'll come up with
> an architectural overview for the feature design and a breakdown of major
> milestones. When ready, I'll share them on this list and open it for
> discussion. Based on the results, code changes can commence.
>
> A few observations based upon my past poking around this area.
>
> The current implementation of the pristine store is designed to be
> "streamy." That is, external users aren't supposed to know or
> care
> where the actual contents live, or how they are accessed, but simply
> get a stream from which they can read and write the contents. In
> principle, this should make compressing said contents relatively easy,
> as we could just insert a compressing stream in this pipeline and
> everything would automagically work. Since this hasn't yet happened,
> you can probably guess that it isn't as easy as that. :)
Precisely why I have my cautious-hat on. If it were that straightforward, it'd have been long done by now.
>
> The primary issue when I looked at this problem was that the streamy
> abstraction is broken in several places, such as when we install the
> new pristine file. There are also certain consumers, such as a
> external diff tools, that require an uncompressed on-disk file to
> operate on, and we currently just provide the pristine as that file.
> Compressed pristines would require recreating the uncompressed version
> when such a tool is invoked. Whether this is a useful tradeoff, I
> don't know.
Great stuff. So this is one area to keep in mind. I'm sure there are others as well.
>
> Generally, though, I'm +1 for compressed pristines, as that was one of
> the design goals of wc-ng in the first place. (Oh, and extra points
> for selectively compressing pristines based upon mime-type.)
Absolutely.
>
> So start digging in, asking on the dev@ list and #svn-dev on Freenode,
> and sending in patches. You'll find a community of folks eager for
> your input, and willing to help you.
Great response! Thanks for the boost.
One question: Are there any (serious) technical discussions to point to? I'm scrapping the lists and it's all sad arguments dragging on forever regarding .Net and whatnot. Either tech discussions on this topic are drowned by the flame wars, or my keywords are dumb. Either way, I'll appreciate any pointers.
-Ash
>
> Hope that helps,
> -Hyrum
>
>
> --
>
> uberSVN: Apache Subversion Made Easy
> http://www.uberSVN.com/
>
RE: Compressed Pristines
Posted by Bert Huijben <be...@qqmail.nl>.
> -----Original Message-----
> From: Mark Phippard [mailto:markphip@gmail.com]
> Sent: maandag 12 maart 2012 16:26
> To: Erik Huelsmann
> Cc: dev
> Subject: Re: Compressed Pristines
>
> On Mon, Mar 12, 2012 at 11:15 AM, Erik Huelsmann <eh...@gmail.com>
> wrote:
>
> > Exactly. So what you found is that for any eol style other than native,
we
> > use exactly that style. For native, we use LF.
>
> Just to bring this back on topic and to my original question, I was
> asking whether Hyrum's assertion that we pass the raw pristine to
> external diff tools is true. I was simply saying that would "break"
> these tools on Windows when the very commonly used
> svn:eol-style=native option is used. So it sounds like that is true
> and these tools would have to ignore whitespace to do a proper diff on
> Windows?
I think we also normalize the in-working-copy file to the same format before
passing it to a diff tool, so the diff tool doesn't have to do this hard
work.
Note that this is only relevant to diff tools that are hooked in the
Subversion configuration. Tools like TortoiseSVN don't use our diff API, but
get the whole file instead.
(AnkhSVN just uses 'svn cat' to get the pristine file translated in local
format, including expanded keywords, etc. And then it maintains its own copy
while needed)
I'm not sure what the current state is, but in the past (around 1.5)
TortoiseSVN took the shortcut and just fetched the pristine file using a
svn_wc_ api.
Bert
Re: Compressed Pristines
Posted by Mark Phippard <ma...@gmail.com>.
On Mon, Mar 12, 2012 at 11:15 AM, Erik Huelsmann <eh...@gmail.com> wrote:
> Exactly. So what you found is that for any eol style other than native, we
> use exactly that style. For native, we use LF.
Just to bring this back on topic and to my original question, I was
asking whether Hyrum's assertion that we pass the raw pristine to
external diff tools is true. I was simply saying that would "break"
these tools on Windows when the very commonly used
svn:eol-style=native option is used. So it sounds like that is true
and these tools would have to ignore whitespace to do a proper diff on
Windows?
--
Thanks
Mark Phippard
http://markphip.blogspot.com/
Fwd: Compressed Pristines
Posted by Erik Huelsmann <eh...@gmail.com>.
Forwarding my response back to the list...
---------- Forwarded message ----------
From: Erik Huelsmann <eh...@gmail.com>
Date: Mon, Mar 12, 2012 at 4:14 PM
Subject: Re: Compressed Pristines
To: Johan Corveleyn <jc...@gmail.com>
Hi Johan,
> Has nothing to do with the property. The pristine matches the repository,
> > byte for byte. The file installed in the working copy is affected by the
> > property; not the pristine.
>
> Yes, the pristine matches the repository. But what I mean is:
>
> (on Windows):
> $ create file-with-crlf.txt
> $ svn add file-with-crlf.txt
> $ svn ps svn:eol-style native file-with-crlf.txt
> $ svn commit -mm file-with-crlf.txt
>
> -> pristine file is LF-terminated (as is the file in the repos, as you
> point out).
>
This is correct: line endings get normalized to LF when svn:eol-style
'native' is applied.
> $ create file-with-crlf.txt
> $ svn add file-with-crlf.txt
> $ svn commit -mm file-with-crlf.txt
>
> -> pristine file CRLF-terminated.
>
This is correct: file doesn't have any transformation applied: we preserve
the input file.
> $ create file-with-crlf.txt
> $ svn add file-with-crlf.txt
> $ svn ps svn:eol-style CRLF file-with-crlf.txt
> $ svn commit -mm file-with-crlf.txt
>
> -> pristine file CRLF-terminated.
>
This is correct: it's the normal form for files with CRLF applied (before
you ask: files with CR line ending normalization get transformed to CR
only).
> $ create file-with-crlf.txt
> $ svn add file-with-crlf.txt
> $ svn ps svn:eol-style LF file-with-crlf.txt
> $ svn commit -mm file-with-crlf.txt
>
> -> pristine file is LF-terminated (as is the working-copy file).
Exactly. So what you found is that for any eol style other than native, we
use exactly that style. For native, we use LF.
HTH,
Erik.
Re: Compressed Pristines
Posted by Johan Corveleyn <jc...@gmail.com>.
On Mon, Mar 12, 2012 at 3:03 PM, Greg Stein <gs...@gmail.com> wrote:
>
> On Mar 12, 2012 9:59 AM, "Johan Corveleyn" <jc...@gmail.com> wrote:
>>...
>
>
>> (BTW: the pristine file (on Windows) only has LF line-endings when
>> svn:eol-style=native (or =LF). When it's svn:eol-style=CRLF, the
>> pristine file has CRLF (as does the file in the repository))
>
> Has nothing to do with the property. The pristine matches the repository,
> byte for byte. The file installed in the working copy is affected by the
> property; not the pristine.
Yes, the pristine matches the repository. But what I mean is:
(on Windows):
$ create file-with-crlf.txt
$ svn add file-with-crlf.txt
$ svn ps svn:eol-style native file-with-crlf.txt
$ svn commit -mm file-with-crlf.txt
-> pristine file is LF-terminated (as is the file in the repos, as you
point out).
$ create file-with-crlf.txt
$ svn add file-with-crlf.txt
$ svn commit -mm file-with-crlf.txt
-> pristine file CRLF-terminated.
$ create file-with-crlf.txt
$ svn add file-with-crlf.txt
$ svn ps svn:eol-style CRLF file-with-crlf.txt
$ svn commit -mm file-with-crlf.txt
-> pristine file CRLF-terminated.
$ create file-with-crlf.txt
$ svn add file-with-crlf.txt
$ svn ps svn:eol-style LF file-with-crlf.txt
$ svn commit -mm file-with-crlf.txt
-> pristine file is LF-terminated (as is the working-copy file).
--
Johan
Re: Compressed Pristines
Posted by Greg Stein <gs...@gmail.com>.
On Mar 12, 2012 9:59 AM, "Johan Corveleyn" <jc...@gmail.com> wrote:
>...
> (BTW: the pristine file (on Windows) only has LF line-endings when
> svn:eol-style=native (or =LF). When it's svn:eol-style=CRLF, the
> pristine file has CRLF (as does the file in the repository))
Has nothing to do with the property. The pristine matches the repository,
byte for byte. The file installed in the working copy is affected by the
property; not the pristine.
Cheers,
-g
Re: Compressed Pristines
Posted by Johan Corveleyn <jc...@gmail.com>.
On Mon, Mar 12, 2012 at 2:36 PM, Mark Phippard <ma...@gmail.com> wrote:
> On Mon, Mar 12, 2012 at 9:31 AM, Hyrum K Wright
> <hy...@wandisco.com> wrote:
>
>> The primary issue when I looked at this problem was that the streamy
>> abstraction is broken in several places, such as when we install the
>> new pristine file. There are also certain consumers, such as a
>> external diff tools, that require an uncompressed on-disk file to
>> operate on, and we currently just provide the pristine as that file.
>> Compressed pristines would require recreating the uncompressed version
>> when such a tool is invoked. Whether this is a useful tradeoff, I
>> don't know.
>
> When svn:eol-style keyword is set I thought the pristine was always
> stored with LF line-endings? Wouldn't that "break" external diff
> tools on Windows (which I do not think is the case today but maybe it
> is).
I'm not sure it this is what you mean, but there is an open issue
regarding wrong eol-style in diffs on Windows (but it's with the
internal diff --- perhaps it just has the exact same problem as the
one you're suggesting here for external diff tools):
http://subversion.tigris.org/issues/show_bug.cgi?id=3338 (Inconsistent
line endings when diffing svn:eol-style native file)
(BTW: the pristine file (on Windows) only has LF line-endings when
svn:eol-style=native (or =LF). When it's svn:eol-style=CRLF, the
pristine file has CRLF (as does the file in the repository))
--
Johan
Re: Compressed Pristines
Posted by Mark Phippard <ma...@gmail.com>.
On Mon, Mar 12, 2012 at 9:31 AM, Hyrum K Wright
<hy...@wandisco.com> wrote:
> The primary issue when I looked at this problem was that the streamy
> abstraction is broken in several places, such as when we install the
> new pristine file. There are also certain consumers, such as a
> external diff tools, that require an uncompressed on-disk file to
> operate on, and we currently just provide the pristine as that file.
> Compressed pristines would require recreating the uncompressed version
> when such a tool is invoked. Whether this is a useful tradeoff, I
> don't know.
When svn:eol-style keyword is set I thought the pristine was always
stored with LF line-endings? Wouldn't that "break" external diff
tools on Windows (which I do not think is the case today but maybe it
is).
--
Thanks
Mark Phippard
http://markphip.blogspot.com/
Re: Compressed Pristines (Summary)
Posted by Ashod Nakashian <as...@yahoo.com>.
----- Original Message -----
> From: Branko Čibej <br...@apache.org>
> To: Ashod Nakashian <as...@yahoo.com>
> Cc: "dev@subversion.apache.org" <de...@subversion.apache.org>
> Sent: Sunday, April 1, 2012 12:23 PM
> Subject: Re: Compressed Pristines (Summary)
>
> On 31.03.2012 23:30, Ashod Nakashian wrote:
>>>> Git can keep deleted items until git-gc is invoked, should we
> support
>>> something similar, we need to be consistent and probably support
> arbitrary
>>> revision history, which is out of scope.
>>>
>>> I'm confused: how does revision history affect the pristine store?
>> If the pristine store also keeps multiple revisions, then it's a whole
> different set of features than what we are aiming for (at least for compressed
> pristines).
>
> Certainly the pristine store keeps multiple revisions of files. After
> all, it's just a SHA-1 => contents dictionary, so every time you
> "svn
> update," you'll get new revisions of files in the pristine store.
Sure. I meant multiple revisions of the same file. You're absolutely right, the PS tracks SHA-1 and whether two files are revisions of the /same/ file or not isn't relevant. What I meant to say is that if we are to have such a case, we probably need to add support for it on the higher level where files/revisions/SHA-1's/references are tracked. This is out of scope and changes the very definition of the PS as we have it now.
>
> What the store doesn't do is /know/ about the revisions. Neither does
> the wc.db, which only tracks reference counts for the SHA-1 keys. Every
> time a file changes, its hash will change, too, a new key will be
> inserted in the pristine store, and the reference count for the old key
> will be decremented. I'm not sure what happens when the count reaches
> zero; used to be that only "svn cleanup" would delete unreferenced
> pristines, but ISTR this changed a while ago.
>
> In any case, the pristine store shouldn't worry about revisions, only
> about efficiently storing the contents. It doesn't even have to worry
> about reference counting, since wc.db already does that.
>
> -- Brane
>
>
> P.S.: If we ever implement local snapshots and/or local branches, it
> /still/ won't be the pristine store's problem to track whole-tree info.
> This is why I like the clear separation between pristine store, which is
> a simple dictionary, and wc.db, which is moderately complex.
>
>
> P.P.S.: When we transition from pristine store per working copy to
> pristine store per ~/.subversion directory, then the pristine store will
> have to track how many working copies are using it. But that's way in
> the future -- and another good reason to use a proper database for the
> indexing.
>
Sure. We're on the same page here on all points.
-Ash
Re: Compressed Pristines (Summary)
Posted by Branko Čibej <br...@apache.org>.
On 31.03.2012 23:30, Ashod Nakashian wrote:
>>> Git can keep deleted items until git-gc is invoked, should we support
>> something similar, we need to be consistent and probably support arbitrary
>> revision history, which is out of scope.
>>
>> I'm confused: how does revision history affect the pristine store?
> If the pristine store also keeps multiple revisions, then it's a whole different set of features than what we are aiming for (at least for compressed pristines).
Certainly the pristine store keeps multiple revisions of files. After
all, it's just a SHA-1 => contents dictionary, so every time you "svn
update," you'll get new revisions of files in the pristine store.
What the store doesn't do is /know/ about the revisions. Neither does
the wc.db, which only tracks reference counts for the SHA-1 keys. Every
time a file changes, its hash will change, too, a new key will be
inserted in the pristine store, and the reference count for the old key
will be decremented. I'm not sure what happens when the count reaches
zero; used to be that only "svn cleanup" would delete unreferenced
pristines, but ISTR this changed a while ago.
In any case, the pristine store shouldn't worry about revisions, only
about efficiently storing the contents. It doesn't even have to worry
about reference counting, since wc.db already does that.
-- Brane
P.S.: If we ever implement local snapshots and/or local branches, it
/still/ won't be the pristine store's problem to track whole-tree info.
This is why I like the clear separation between pristine store, which is
a simple dictionary, and wc.db, which is moderately complex.
P.P.S.: When we transition from pristine store per working copy to
pristine store per ~/.subversion directory, then the pristine store will
have to track how many working copies are using it. But that's way in
the future -- and another good reason to use a proper database for the
indexing.
Re: Compressed Pristines (Summary)
Posted by Ashod Nakashian <as...@yahoo.com>.
----- Original Message -----
> From: Branko Čibej <br...@apache.org>
> To: dev@subversion.apache.org
> Cc:
> Sent: Sunday, April 1, 2012 12:58 AM
> Subject: Re: Compressed Pristines (Summary)
>
> On 31.03.2012 18:16, Ashod Nakashian wrote:
>> So it's fair to say I'm ignorant about the details, but I must say
> this: A repository, precisely like Git pack files, don't necessarily need
> good (if at all) support of deletion. This is a very critical issue that I can
> see why it might not be obvious at first.
>
> Instead of repeating the obvious, I suggest you start reading here:
>
> http://www.sqlite.org/pragma.html#pragma_auto_vacuum
>
> It's clear that, in order to optimize the pristine store, the pristine
> files should not be stored in wc.db but in a separate database (simply
> because auto-vacuum optimization will be different for wc.db and
> pristine.db). Apart from that, I still don't see how a custom pack
> format can do better in the short term than what SQLite already does.
>
In the short term, it probably won't do any better (especially for small WC's). In the long term, we'll have control over both organization/defragmentation, compression, and virtually all operations and behaviors. As for the PS residing in a separate db, I think there is no question about that - it should be separate from wc.db.
>
>> Git can keep deleted items until git-gc is invoked, should we support
> something similar, we need to be consistent and probably support arbitrary
> revision history, which is out of scope.
>
> I'm confused: how does revision history affect the pristine store?
If the pristine store also keeps multiple revisions, then it's a whole different set of features than what we are aiming for (at least for compressed pristines).
>
>> Sqlite (which internally uses a b-tree pointing to fixed-size pages that
> overflow using linked-lists) is designed for fast
> additions/modifications/deletions of typically tiny data (a row is reasonably
> assumed to be -much- less than a page in most cases)
>
> Are you quite sure about that? Certainly, the /keys/ need to be much
> smaller than a page size in order for the B+-tree implementation to be
> reasonably efficient, but I can't see how that can be the case for
> BLOBs, which are treated differently all the way from SQL semantics
> level to the C API, and aren't keys.
Yes, I'm fairly certain. There are b-tree specific pages that hold the b-tree information. See http://www.sqlite.org/fileformat2.html for more details. But again, I'd like to have hard numbers than to speculate based on theory.
>
>> and *without* promising a compact footprint, which we dearly care about.
>
> Not all the time. It's OK to make it "compact" only during
> "svn
> cleanup", and if we add a "--gc" option to that (which would, I
> expect,
> invoke SQLite's VACUUM command), then the user will clearly understand
> that they're trading time for space.
Fair enough, provided that's a reasonable compromise that is documented and given.
>
>> We will be doing the same on KBytes worth of data for each entry. This is
> something that we must certainly research more with actual data. However in my
> mind our
>> use-case is quite different from what Sqlite is designed to do best, which
> is why I'm suggesting we do some benchmarking if we go with Sqlite.
>>
>> Just wanted to make this clear just to be sure we're not talking cross
> purposes at this point.
>
> I suspect that benchmarking for its own sake is not worth the trouble at
> this point. Just go and start implementing the proposal, it'll be a lot
> easer to benchmark once the client actually uses the compressed, packed
> pristine store -- because you'll be able to use real-world datasets, not
> contrived ones.
Yes, I meant benchmarking actual implementation to collect more data to decide how to proceed.
>
> Since we now have a set of performance tests, it might not be a bad idea
> to incorporate compressed/uncompressed pristine in the comparison charts.
Absolutely, agreed.
-Ash
>
> -- Brane
>
Re: Compressed Pristines (Summary)
Posted by Branko Čibej <br...@apache.org>.
On 31.03.2012 18:16, Ashod Nakashian wrote:
> So it's fair to say I'm ignorant about the details, but I must say this: A repository, precisely like Git pack files, don't necessarily need good (if at all) support of deletion. This is a very critical issue that I can see why it might not be obvious at first.
Instead of repeating the obvious, I suggest you start reading here:
http://www.sqlite.org/pragma.html#pragma_auto_vacuum
It's clear that, in order to optimize the pristine store, the pristine
files should not be stored in wc.db but in a separate database (simply
because auto-vacuum optimization will be different for wc.db and
pristine.db). Apart from that, I still don't see how a custom pack
format can do better in the short term than what SQLite already does.
> Git can keep deleted items until git-gc is invoked, should we support something similar, we need to be consistent and probably support arbitrary revision history, which is out of scope.
I'm confused: how does revision history affect the pristine store?
> Sqlite (which internally uses a b-tree pointing to fixed-size pages that overflow using linked-lists) is designed for fast additions/modifications/deletions of typically tiny data (a row is reasonably assumed to be -much- less than a page in most cases)
Are you quite sure about that? Certainly, the /keys/ need to be much
smaller than a page size in order for the B+-tree implementation to be
reasonably efficient, but I can't see how that can be the case for
BLOBs, which are treated differently all the way from SQL semantics
level to the C API, and aren't keys.
> and *without* promising a compact footprint, which we dearly care about.
Not all the time. It's OK to make it "compact" only during "svn
cleanup", and if we add a "--gc" option to that (which would, I expect,
invoke SQLite's VACUUM command), then the user will clearly understand
that they're trading time for space.
> We will be doing the same on KBytes worth of data for each entry. This is something that we must certainly research more with actual data. However in my mind our
> use-case is quite different from what Sqlite is designed to do best, which is why I'm suggesting we do some benchmarking if we go with Sqlite.
>
> Just wanted to make this clear just to be sure we're not talking cross purposes at this point.
I suspect that benchmarking for its own sake is not worth the trouble at
this point. Just go and start implementing the proposal, it'll be a lot
easer to benchmark once the client actually uses the compressed, packed
pristine store -- because you'll be able to use real-world datasets, not
contrived ones.
Since we now have a set of performance tests, it might not be a bad idea
to incorporate compressed/uncompressed pristine in the comparison charts.
-- Brane
Re: Compressed Pristines (Summary)
Posted by Ashod Nakashian <as...@yahoo.com>.
----- Original Message -----
> From: Stefan Sperling <st...@elego.de>
> To: Ashod Nakashian <as...@yahoo.com>
> Cc: "dev@subversion.apache.org" <de...@subversion.apache.org>
> Sent: Saturday, March 31, 2012 7:47 PM
> Subject: Re: Compressed Pristines (Summary)
>
> On Sat, Mar 31, 2012 at 01:31:15AM -0700, Ashod Nakashian wrote:
>> ::Summary::
>
> Thanks for summarizing the discussion.
> This summary was very useful to me.
>
>> 3) Sqlite has a very reputable code-base and performance, in addition
>> to already being utilized by SVN. A proposal to use it for small
>> pristine file storage has been proposed. The major advantage is the
>> possibility of abusing and/or overloading Sqlite with this kind of
>> usage that it probably isn't optimized to handle.
>
> Sqlite should be capable of handling this well.
> Are you aware of fossil (http://fossil-scm.org)?
> This is the version control system used to manage sqlite, and not
> surprisingly it stores all of its revision and working copy meta
> data in sqlite. Fossil is kept very simple at its core and might
> have scalability issues with very large projects (such as webkit)
> but nevertheless it is very inspiring. It might be worthwhile to
> take a look at the details of how fossil stores revision file data
> (because fossil is a distributed version control system the pristine
> files are simply stored in the last committed revision).
I hadn't known that fossil uses sqlite, although I was familiar with it (if nothing, because Sqlite uses it!).
So it's fair to say I'm ignorant about the details, but I must say this: A repository, precisely like Git pack files, don't necessarily need good (if at all) support of deletion. This is a very critical issue that I can see why it might not be obvious at first. At least one person (sorry, I don't readily have a name) raised a possible reinventing-the-wheel flag with the proposed pack format and Git's pack file. Git's pack *is* the repository. Technically, a repository needs to at least emulate the behavior of deletes, but it certainly doesn't have the performance issue as they almost never support arbitrary deletions (that is, history rewriting by removing a historical versions of files). Git has some support of history rewriting (typically via rebase) but even then, it can defer housekeeping cleanup to git-gc, which is a slow and by definition an offline operation. Compare this with our case where we keep the latest revision (known to us) only and all
files are subject to updates/modification and deletion upon invoking SVN commands. Whatever our pristine storage, it must do these rather swiftly. (I know I'm oversimplifying, but I trust I'm not misrepresenting.)
If we find some way to go around this requirement (say by doing things "quick'n'dirty" and deferring cleanups) then we probably can reuse some of the numerous archives, be it Git's pack or any other. But that comes at a cost and, unlike Git, we don't have any advantages to offer in return. Git can keep deleted items until git-gc is invoked, should we support something similar, we need to be consistent and probably support arbitrary revision history, which is out of scope. Sqlite (which internally uses a b-tree pointing to fixed-size pages that overflow using linked-lists) is designed for fast additions/modifications/deletions of typically tiny data (a row is reasonably assumed to be -much- less than a page in most cases) and *without* promising a compact footprint, which we dearly care about. We will be doing the same on KBytes worth of data for each entry. This is something that we must certainly research more with actual data. However in my mind our
use-case is quite different from what Sqlite is designed to do best, which is why I'm suggesting we do some benchmarking if we go with Sqlite.
Just wanted to make this clear just to be sure we're not talking cross purposes at this point.
>
> I haven't yet spent enough time thinking about compressed pristines
> to have an opinion about which approach we should take. But I'm very
> much looking forward to seeing a patch that implements a first step
> or first milestone of whichever approach we're going to settle on.
>
> I'm glad to see somebody driving this feature forward. Thanks!
>
Thanks Stephan! I'm excited about the prospects myself.
-Ash
Re: Compressed Pristines (Summary)
Posted by Stefan Sperling <st...@elego.de>.
On Sat, Mar 31, 2012 at 01:31:15AM -0700, Ashod Nakashian wrote:
> ::Summary::
Thanks for summarizing the discussion.
This summary was very useful to me.
> 3) Sqlite has a very reputable code-base and performance, in addition
> to already being utilized by SVN. A proposal to use it for small
> pristine file storage has been proposed. The major advantage is the
> possibility of abusing and/or overloading Sqlite with this kind of
> usage that it probably isn't optimized to handle.
Sqlite should be capable of handling this well.
Are you aware of fossil (http://fossil-scm.org)?
This is the version control system used to manage sqlite, and not
surprisingly it stores all of its revision and working copy meta
data in sqlite. Fossil is kept very simple at its core and might
have scalability issues with very large projects (such as webkit)
but nevertheless it is very inspiring. It might be worthwhile to
take a look at the details of how fossil stores revision file data
(because fossil is a distributed version control system the pristine
files are simply stored in the last committed revision).
I haven't yet spent enough time thinking about compressed pristines
to have an opinion about which approach we should take. But I'm very
much looking forward to seeing a patch that implements a first step
or first milestone of whichever approach we're going to settle on.
I'm glad to see somebody driving this feature forward. Thanks!
Re: Compressed Pristines (Design Doc)
Posted by Daniel Shahaf <da...@elego.de>.
Ashod Nakashian wrote on Thu, Mar 22, 2012 at 08:18:40 -0700:
> >________________________________
> > From: Daniel Shahaf <da...@elego.de>
> >To: Ashod Nakashian <as...@yahoo.com>
> >Cc: "dev@subversion.apache.org" <de...@subversion.apache.org>
> >Sent: Thursday, March 22, 2012 7:30 AM
> >Subject: Re: Compressed Pristines (Design Doc)
> >
> >OK, I've had a cruise through now.
> >
> >First of all I have to say it's an order of magnitude larger than what
> >I'd imagined it would be. That makes the "move it elsewhere" idea I'd
> >had less practical than I'd predicted. I'm also not intending to take
> >you up on your offer to proxy me to the doc, though thanks for making it.
>
> If there are any ideas for simplifying things, I think it's well worth
> the effort. I for one am not for unecessary complexity. This is why
> I took the time to outline a set of requirements. If the requirements
> are excessive, let's simply them first. And based on the requirements
> alone can one justify the design.
>
Fair enough.
One requirement is extensibility (features in 1.9 timeframe, assuming
your design is released in 1.8). I see you included a format number,
but --- for example --- perhaps the index entries should contain a few
RESERVED bytes too? (It would have help a lot in manually fixing FSFS
corruptions if we'd left a few unused bytes here and there in revision
files...)
Another requirement is concurrency. ra_serf downloads files
concurrently, and the editor (svn_delta_editor_t, 1.8's svn_editor_t)
allows retrieving the text of multiple files concurrently. Does your
design allow for adding two new pristines with their contents arriving
interleaved? (There is one thread in the client process, but several
TCP sockets.)
> >
> >Design-wise I'm a bit surprised that the choice ended up being rolling
> >a custom file format.
>
> Personally I know not of any library that can deliver the requirements
> that we need (outlined in the doc). Again, if the requirements are in
I'm not familiar offhand with such a library either, but perhaps someone
else on list is.
> question, let's simplify them. If there is such a library, suggesting
> it will save us a lot of time and effort. Otherwise, using a Tar-like
> container will just not cut it. On the other hand, the proposed custom
> format is rather simple and its code shouldn't be complex. In fact,
> I suspect Tar is more complex (considering it must store more
> information than we do).
>
Let's see how far we can get with the custom format. If the "someone
invented that wheel already" factor pops up too often I'm sure we'll
notice.
Cheers,
Daniel
>
> -Ash
>
> >
> >Thanks for your work.
> >
> >Cheers,
> >
> >Daniel
> >
> >Ashod Nakashian wrote on Thu, Mar 22, 2012 at 00:15:21 -0700:
> >> >________________________________
> >> > From: Daniel Shahaf <da...@elego.de>
> >> >To: Greg Stein <gs...@gmail.com>
> >> >Cc: Ashod Nakashian <as...@yahoo.com>; dev@subversion.apache.org
> >> >Sent: Wednesday, March 21, 2012 2:08 PM
> >> >Subject: Re: Compressed Pristines (Design Doc)
> >> >
> >> >Greg Stein wrote on Wed, Mar 21, 2012 at 16:51:47 -0400:
> >> >> On Wed, Mar 21, 2012 at 16:11, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> >> >> > Ashod Nakashian wrote on Wed, Mar 21, 2012 at 12:19:02 -0700:
> >> >> >> All,
> >> >> >>
> >> >> >> I'm happy to share[1] with you the design document for the Compressed Pristines feature. The document is public and anyone can comment on any part
> >> >> >
> >> >> > I can't. Can you please move the document to our wiki, or dump it in an
> >> >> > email to dev@, or on a pastebin, somewhere everyone canread it.
> >> >>
> >> >> I just opened it in an incognito window in Chrome. You should be able
> >> >> to access the thing.
> >> >>
> >> >
> >> >Tried, I get as far as the doc title. I don't see its contents.
> >>
> >>
> >> Daniel (and all who can't access the doc),
> >>
> >> I'm attaching the PDF and ODT versions with updates based on Greg's comments. I'd like to hear all opinions and comments. Google docs is a fairly ideal environment for live commenting and editing, so it's too bad that you can't access the file.
> >>
> >> Please let me know if you have any notes/comments on the design. If you'd like to use the ODT file for comments and edits, please mark your input clearly and I'll update the Google doc with your notes.
> >>
> >> Thanks,
> >> Ash
> >
> >
> >
> >
> >
> >
Re: Compressed Pristines (Summary)
Posted by Daniel Shahaf <da...@elego.de>.
Ashod Nakashian wrote on Wed, Apr 04, 2012 at 11:57:45 -0700:
> I think we either agree that SVN should improve its footprint or we
> don't.
I agree with making svn_wc__pristine_*() smarter and I disagree with
teaching svn the proper mount(8) flags for all platforms APR supports.
Daniel
(than ks for your mail, btw. I read all of it, even though I snipped heavily)
Re: Compressed Pristines (Summary)
Posted by Ashod Nakashian <as...@yahoo.com>.
----- Original Message -----
> From: Daniel Shahaf <da...@elego.de>
> To: Ashod Nakashian <as...@yahoo.com>
> Cc: Markus Schaber <m....@3s-software.com>; "julianfoad@btopenworld.com" <ju...@btopenworld.com>; "mtherieau@gmail.com" <mt...@gmail.com>; Subversion Development <de...@subversion.apache.org>
> Sent: Wednesday, April 4, 2012 10:29 PM
> Subject: Re: Compressed Pristines (Summary)
>
> Ashod Nakashian wrote on Wed, Apr 04, 2012 at 10:18:47 -0700:
>> >________________________________
>> > From: Daniel Shahaf <da...@elego.de>
>> >To: Ashod Nakashian <as...@yahoo.com>
>> >Cc: Markus Schaber <m....@3s-software.com>;
> "julianfoad@btopenworld.com" <ju...@btopenworld.com>;
> "mtherieau@gmail.com" <mt...@gmail.com>; Subversion
> Development <de...@subversion.apache.org>
>> >Sent: Wednesday, April 4, 2012 9:46 AM
>> >Subject: Re: Compressed Pristines (Summary)
>> >
>> >> >1. Filesystem compression.
>> >> >
>> >> >Would you like to assess the feasibility of compressing the
> pristine
>> >> >store by re-mounting the "pristines" subdirectory as
> a compressed
>> >> >subtree in the operating system's file system?
>> >>
>> >> No :-)
>> >>
>> >> There are two ways to answer this interesting proposition of
>> >> compressed file-systems. The obvious one is that it isn't
> something
>> >> SVN can or should control. The file-system and certainly system
>> >> drivers are up to the user and any requirement or suggestion of
>> >> tempering with them is decidedly unwarranted and unexpected from
>> >> a VCS.
>> >
>> >The suggestion wasn't that you teach svn how to change the OS's
> fs
>> >settinsg, it was that you investigate how solutions at the OS level
>> >compare to the other approaches already suggested (custom format -based
>> >and sqlite-based pristine store).
>>
>> That's an easy question. The answer is that at *best* they'll do as
>> good as in-place compression. However, in practice they'll do much
>> worse. The reason is that the OS level compression works on not only
>
> Is it _necessarily_ that way? What does Subversion about the pristine
> store's contents know that the filesystem doesn't?
No, not unless an OS cares about high performance that is independent of file-size. It's reasonable or an OS to assume random file access for both reading and writing. Recompressing the complete file on each write is not feasible, so whole files aren't compressed by OS compression. Furthermore, they use "real time" compression algorithms that are not very efficient, but are very fast and have low memory footprint.
Subvesion *knows* that pristine files are *never* modified, they are always replaced. (Note for the technically-correct: SVN might get a diff on the wire to update a prisine file, but as far as we care, the file must be completely read/parsed/patched/updated, so in the end, the whole file is streamed back to disk, not an arbitrary chunk, although for binary files this might not be the case. Still, even in that case we can use chunking to limit the largest number of bytes that must be recompressed, so large files can still be partially updated without major overheads.)
>
>> the single file level, but actually at the block level. This is to
>> make modifications reasonably fast (read compressed data, uncompress,
>> modify, write recompressed data). If the complete file is compressed
>> then even changing a single byte (neglecting that no storage works on
>> the byte-level anyway) will yield performance that will at least
>> linearly degrade by the filesize.
>>
>>
>> >
>> >In short: if 'mount -o compress=yes' provides 90% space savings
> then we
>> >would have little reason to implement space-saving solutions in svn
> itself.
>> >But it's the user's, not svn's, responsibility to run that.
>>
>>
>> I should kindly disagree here. The user can do that any time, anyway.
>> SVN is trying to improve its pristine store design,
>
> No we don't. We're trying to provide users with a low-footprint
> pristine store. If we can achieve that by tuning OS settings we
> might not need to write code.
As pointed out already, that's not portable, reasonable to expect of a VCS, achievable for all uses (due to permissions for example) or enforceable (for a unified experience).
>
>> not advise users
>> on how best to organize their storage (in general or when using SVN).
>> In addition, I find discriminating against users who don't have that
>> luxury or knowledge to be a bit unfair. At least if are claiming to
>> support the wide range of systems that we do.
>>
>
> Yes, I edited that out of my previous email: we should ensure that
> "low-footprint pristine store" is achievable on most/all platforms we
> support.
>
> Also, agreed that we should consider the case of users don't have
> permissions to tune their OS settings but have working copies.
I've just repeated this much a few lines above. I think we either agree that SVN should improve its footprint or we don't. If we do, then we need a built-in solution. If we don't, then whether the user is smart enough to use some trick or not becomes irrelevant; we can't force them either way.
>
>> -Ash
>>
>>
>> >
>
Re: Compressed Pristines (Summary)
Posted by Daniel Shahaf <da...@elego.de>.
Ashod Nakashian wrote on Wed, Apr 04, 2012 at 10:18:47 -0700:
> >________________________________
> > From: Daniel Shahaf <da...@elego.de>
> >To: Ashod Nakashian <as...@yahoo.com>
> >Cc: Markus Schaber <m....@3s-software.com>; "julianfoad@btopenworld.com" <ju...@btopenworld.com>; "mtherieau@gmail.com" <mt...@gmail.com>; Subversion Development <de...@subversion.apache.org>
> >Sent: Wednesday, April 4, 2012 9:46 AM
> >Subject: Re: Compressed Pristines (Summary)
> >
> >> >1. Filesystem compression.
> >> >
> >> >Would you like to assess the feasibility of compressing the pristine
> >> >store by re-mounting the "pristines" subdirectory as a compressed
> >> >subtree in the operating system's file system?
> >>
> >> No :-)
> >>
> >> There are two ways to answer this interesting proposition of
> >> compressed file-systems. The obvious one is that it isn't something
> >> SVN can or should control. The file-system and certainly system
> >> drivers are up to the user and any requirement or suggestion of
> >> tempering with them is decidedly unwarranted and unexpected from
> >> a VCS.
> >
> >The suggestion wasn't that you teach svn how to change the OS's fs
> >settinsg, it was that you investigate how solutions at the OS level
> >compare to the other approaches already suggested (custom format -based
> >and sqlite-based pristine store).
>
> That's an easy question. The answer is that at *best* they'll do as
> good as in-place compression. However, in practice they'll do much
> worse. The reason is that the OS level compression works on not only
Is it _necessarily_ that way? What does Subversion about the pristine
store's contents know that the filesystem doesn't?
> the single file level, but actually at the block level. This is to
> make modifications reasonably fast (read compressed data, uncompress,
> modify, write recompressed data). If the complete file is compressed
> then even changing a single byte (neglecting that no storage works on
> the byte-level anyway) will yield performance that will at least
> linearly degrade by the filesize.
>
>
> >
> >In short: if 'mount -o compress=yes' provides 90% space savings then we
> >would have little reason to implement space-saving solutions in svn itself.
> >But it's the user's, not svn's, responsibility to run that.
>
>
> I should kindly disagree here. The user can do that any time, anyway.
> SVN is trying to improve its pristine store design,
No we don't. We're trying to provide users with a low-footprint
pristine store. If we can achieve that by tuning OS settings we
might not need to write code.
> not advise users
> on how best to organize their storage (in general or when using SVN).
> In addition, I find discriminating against users who don't have that
> luxury or knowledge to be a bit unfair. At least if are claiming to
> support the wide range of systems that we do.
>
Yes, I edited that out of my previous email: we should ensure that
"low-footprint pristine store" is achievable on most/all platforms we
support.
Also, agreed that we should consider the case of users don't have
permissions to tune their OS settings but have working copies.
> -Ash
>
>
> >
Re: Compressed Pristines (Summary)
Posted by Daniel Shahaf <da...@elego.de>.
+1 to what Greg just outlined
Ashod Nakashian wrote on Wed, Apr 04, 2012 at 13:28:06 -0700:
> >________________________________
> > From: Greg Stein <gs...@gmail.com>
> >My vote is compress for files > N bytes (and store on disk), and stick the others into a new pristine.db. Maybe compress before inserting into Sqlite. Not sure. Add a few heuristics for skipping compression on certain files types.
> >Shouldn't be too bad to start with that.
> >Cheers,
> >-g
> >
>
> I feel this is indeed what we're closing on, at least for an initial working demo. But I'd like to hear more agreements before committing to this path. I know some did show support for this approach, but it's hard to track them in the noise.
>
> So to make it easier, let's either voice support to this suggestion and commit to an implementation, or voice objection with at least reasons and possibly alternative action. Silence is passive agreement, so the onus on those opposing ;-)
>
> Thanks to all!
> -Ash
>
Re: Compressed Pristines (Summary)
Posted by "C. Michael Pilato" <cm...@collab.net>.
On 04/04/2012 02:46 PM, Daniel Shahaf wrote:
> But one _could_ write a filesystem that implements compression and/or
> deduplication aimed at .svn/pristine/'s workflow. Should effort be
> spent there rather than on implementing a smarter svn_wc__pristine_*()?
>
> Daniel
> (devil's advocate mode)
"Get thee behind me!"
--
C. Michael Pilato <cm...@collab.net>
CollabNet <> www.collab.net <> Distributed Development On Demand
Re: Compressed Pristines (Summary)
Posted by Hyrum K Wright <hy...@wandisco.com>.
On Thu, Apr 5, 2012 at 11:24 AM, Branko Čibej <br...@apache.org> wrote:
> On 05.04.2012 17:35, Ashod Nakashian wrote:
>>> ________________________________
>>> From: Hyrum K Wright <hy...@wandisco.com>
>>>
>>> I'm glad we've found a way to relegate this problem to a "minor...technicality."
>> So far no objections then.
>>
>> What's the preferred mode of operation in such a case?
>>
>> I can update the proposal and start sending patches for the dev-list to review or I can work in a branch with post-commit reviews.
>
> I'd like to see this happen on trunk, with the whole compressed-pristine
> functionality wrapped in conditional-compilation blocks.
>
> However, there's likely to be a lot of churn and reviewing all those
> patches would never happen in real time. Therefore, I propose you do the
> work on a branch, CTR of course. There should be no problem giving you
> branch commit access, IMO.
And you can speed up the process by filing a CLA, if you have not
already done so:
http://www.apache.org/licenses/icla.pdf
-Hyrum
--
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/
Re: Compressed Pristines (Summary)
Posted by Branko Čibej <br...@apache.org>.
On 05.04.2012 17:35, Ashod Nakashian wrote:
>> ________________________________
>> From: Hyrum K Wright <hy...@wandisco.com>
>>
>> I'm glad we've found a way to relegate this problem to a "minor...technicality."
> So far no objections then.
>
> What's the preferred mode of operation in such a case?
>
> I can update the proposal and start sending patches for the dev-list to review or I can work in a branch with post-commit reviews.
I'd like to see this happen on trunk, with the whole compressed-pristine
functionality wrapped in conditional-compilation blocks.
However, there's likely to be a lot of churn and reviewing all those
patches would never happen in real time. Therefore, I propose you do the
work on a branch, CTR of course. There should be no problem giving you
branch commit access, IMO.
-- Brane
Re: Compressed Pristines (Summary)
Posted by Ashod Nakashian <as...@yahoo.com>.
>________________________________
> From: Hyrum K Wright <hy...@wandisco.com>
>
>I'm glad we've found a way to relegate this problem to a "minor...technicality."
So far no objections then.
What's the preferred mode of operation in such a case?
I can update the proposal and start sending patches for the dev-list to review or I can work in a branch with post-commit reviews. Alternatively, I commit to a fork on a site that has online review support, presumably until we create a branch. I'm good with all options, although, obviously, I prefer to commit my changes in bite-size chunks on a branch.
-Ash
Re: Compressed Pristines (Summary)
Posted by Hyrum K Wright <hy...@wandisco.com>.
On Thu, Apr 5, 2012 at 6:45 AM, Julian Foad <ju...@btopenworld.com> wrote:
> Daniel Shahaf wrote:
>> [Managing uncompressed copies of files] is certainly a -minor-
>> complication we'll have to deal with. It's just a technicality,
>
> That's great, because I believe that is the only significant issue that needs to be solved in order to get a simple compressed pristine store completely working to the point where it could be released.
Same here. As long as our APIs for interacting with some external
tools consist of "provide a valid filename" there will be some cost if
everything has to be decompressed / exported-from-SQLite before we can
use it. Admittedly, many users don't use external tools at all, but
the people who do probably rely upon them heavily.
I'm glad we've found a way to relegate this problem to a "minor...technicality."
-Hyrum
--
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/
Re: Compressed Pristines (Summary)
Posted by Julian Foad <ju...@btopenworld.com>.
Daniel Shahaf wrote:
> I agree with making svn_wc__pristine_*() smarter and I disagree with
> teaching svn the proper mount(8) flags for all platforms APR supports.
Me too. (Note: I never said svn should mount filesystems, I just said it would be interesting to investigate.)
Ashod Nakashian wrote:
> Greg Stein wrote:
>> My vote is compress for files > N bytes (and store on disk), and stick
>> the others into a new pristine.db. [...]
>
> I feel this is indeed what we're closing on, at least for an initial working
> demo. But I'd like to hear more agreements [...]
I'm happy with that. Looking forward to it.
> [Managing uncompressed copies of files] is certainly a -minor-
> complication we'll have to deal with. It's just a technicality,
That's great, because I believe that is the only significant issue that needs to be solved in order to get a simple compressed pristine store completely working to the point where it could be released.
- Julian
RE: Compressed Pristines (Summary)
Posted by Bert Huijben <be...@qqmail.nl>.
> -----Original Message-----
> From: Ashod Nakashian [mailto:ashodnakashian@yahoo.com]
> Sent: woensdag 4 april 2012 13:28
> To: Greg Stein
> Cc: dev@subversion.apache.org
> Subject: Re: Compressed Pristines (Summary)
>
> >________________________________
> > From: Greg Stein <gs...@gmail.com>
> >My vote is compress for files > N bytes (and store on disk), and stick
the
> others into a new pristine.db. Maybe compress before inserting into
Sqlite.
> Not sure. Add a few heuristics for skipping compression on certain files
> types.
> >Shouldn't be too bad to start with that.
> >Cheers,
> >-g
> >
>
> I feel this is indeed what we're closing on, at least for an initial
working demo.
> But I'd like to hear more agreements before committing to this path. I
know
> some did show support for this approach, but it's hard to track them in
the
> noise.
>
> So to make it easier, let's either voice support to this suggestion and
commit
> to an implementation, or voice objection with at least reasons and
possibly
> alternative action. Silence is passive agreement, so the onus on those
> opposing ;-)
+1
The combination of some compression (gzip or plain deflate), maybe some
specific uncompressed files and the small files in SQLite sounds good.
I think the cutoff point for SQLite should be below what we can have in
memory as we can't keep database transactions open to back up streams. 32K
(and a few times higher) should be safe to read in memory at once.
Bert
Re: Compressed Pristines (Summary)
Posted by Ashod Nakashian <as...@yahoo.com>.
Hi Justin,
Sorry for the late reply and thanks for your notes. I should say right off the bat that the design doc is outdated in terms of what we plan to do as a first implementation, although as a proposal for packed file format I think it's still mostly valid, except for a few notes and improvements (such as 64bit filesize) that are missing/invalid (regardless of whether or not we'll ultimately implement it or not).
See my notes and comments inline please.
>________________________________
> From: Justin Erenkrantz <ju...@erenkrantz.com>
>To: Ashod Nakashian <as...@yahoo.com>
>Cc: Greg Stein <gs...@gmail.com>; "dev@subversion.apache.org" <de...@subversion.apache.org>
>Sent: Friday, April 6, 2012 10:19 AM
>Subject: Re: Compressed Pristines (Summary)
>
>On Wed, Apr 4, 2012 at 1:28 PM, Ashod Nakashian
><as...@yahoo.com> wrote:
>> I feel this is indeed what we're closing on, at least for an initial working demo. But I'd like to hear more agreements before committing to this path. I know some did show support for this approach, but it's hard to track them in the noise.
>>
>> So to make it easier, let's either voice support to this suggestion and commit to an implementation, or voice objection with at least reasons and possibly alternative action. Silence is passive agreement, so the onus on those opposing ;-)
>
>I just read the Google doc - glad to see progress here - a few comments:
>
>First off, if I understand correctly, I do have to say that I'm not at
>all a fan of having a large pristine file spread out across multiple
>on-disk compressed pack files. I don't think that makes a whole lot
>of sense - I think it'd be simplest (when we hit the heuristic to put
>it on-disk rather than in SQLite) to keep it to just one file. I
>don't get why we'd want to have a big image pristine file (say a PSD
>file) split out into say 20 smaller files on disk. Why? It just
>seems we're going to introduce a lot of complexity for very little
>return.
The straightforward design is to have a single large pack file. But in practice this is very problematic. You can already find FSes that may barf on multi-GB files, but that aside, consider the overhead of removing prisitine files and shifting the bytes following it. The overhead is extreme. To avoid that, we need to track holes in the files (and incur the wasted space on disk) and (even worse) we need to do heavyweight lifting to accommodate new/modified pristines into these holes where they might not fit! In other words, we have to write a complex FS in a single file and we have to keep its size on disk small (to justify this feature!) and to do housekeeping as fast as possible (shifting GBs on disk because we have a largish hole at the beginning of the file has a cost).
My solution is to split the pack files such that each file is small enough to fit in memory and be written to disk in sub-second times. This way, 1) holes in these files can be avoided completely and swiftly, 2) even if we keep holes, they shouldn't/couldn't be too large.
> The whole point of stashing the small files directly into
>SQLite's pristine.db is to make the small files SQLite's problem and
>not the on-disk FS (and reduce sub-block issues) - with that in place,
>I think we're not going to need to throw multiple files into the same
>pack file. It'll just get too confusing, IMO, to keep track of which
>file offsets to use. (For a large file that already hits the size
>trigger, we know that - worst case scenario - we might lose one FS
>block. Yawn.) We can make the whole strategy simpler if we follow
>that.
I'm a bit confused here. You're assuming that we'll use Sqlite for small files and the FS for larger ones, I'm assuming. However that's not in the proposal, it's what we've agreed on on this list. We aren't going to implement both, not for now at least. What we're going to do is simply push small pristines into pristine.db and in-place compress the larger ones on disk (as a first implementation we'll probably even leave the names the same and change nothing other than passing the disk I/O through compressed streams). Beyond that, we will probably experiment with packing. But it's a bit soon to worry about it. Although any research or help is more than welcome!
>
>I'm with Greg in thinking that we don't need the pack index files -
>but, I think I'll go further and reiterate that I think that there
>should just be a 1:1 correspondence between the pack file and the
>pristine file. What's the real advantage of having multiple large
>pristines in one pack file (and that we constantly *append* to)? And,
>with append FS ops with multiple files in one pack file, we rely on
>our WC/FS locking strategy to be 100% perfect or we have a hosed pack
>file. Ugh. I think it just adds unnecessary complexity. I think
>it'll be far simpler to have 1:1 correspondence with a pack file to a
>single large pristine. We'll have enough complexity already to just
>find the small files sitting in SQLite rather than on-disk.
It's all relative! Saying "multiple large pristines in one pack file" assumes too much. I find it better to first define/find/compute an order of pack file size that satisfies our reqs (my crude math finds that to be in the order of a few MBs - see proposal doc) then it follows automatically the largest pristine that can share a pack file with another. Anything smaller can share a pack file with others, and hence (by our definition!) aren't "too large". Larger ones are "really large" (again by our definition) and so will be compressed alone on disk (ignoring if there will be a pack-header or not is hopefully not debated for now) - practically these files will be in-place compressed, as a result.
As for assuming that we only/constantly append to a pack file, that's unfounded. Files may be removed from a pristine store upon svn up. Even if not, a file modification is reasonably implemented as remove+add. This is the correct way to do it because the files size might change and we need to do the same housekeeping as removing one file and adding an unrelated one. Granted, there is room for improving this. In other words, knowing it's the same prisitine file modified a bit doesn't give us much information to be of practical use.
>
>Given that 1:1 correspondence, I do think that the original file-size
>and the complete checksum should be stored in the custom pack file
>on-disk. It'll make it so that we could easily validate whether the
>pack file is corrupt or not by using file-size (as a first-order
>check) and checksum (as second-order). The thinking here is that if
>the checksum is not in the file contents, but only in the file name
>(or the pristine.db), the file system could very easily lose the
>filename (hello ext3/4!) - this would allow us to verify the integrity
>of the pack file and reassociate it if it gets dis-associated. This
>is less of an issue with the client as it can always refetch - but, if
>the server code ends up using the same on-disk format (as hinted in
>the Google Doc)...then, I think this is important to have in the file
>format from the beginning.
>
>I definitely think that we should store the full 64-bit length
>svn_filesize_t and not be cute and assume no one has a file larger
>than 1TB.
All welcome notes. We will get back to these issues when we have a working version that we can play and experiment with. There is certainly too many things to worry about and perhaps even more tempting points to toy with. To be pragmatic (and productive) I want to focus on getting the simplest working implementation that can justify this feature (i.e. one that does produce real disk savings without too much complexity or performance reduction). But points taken.
>
>I'll disagree with Greg for now and say that it's probably best to
>just pack everything and not try to be cute about not packing certain
>file types - I think that's a premature optimization right now. I
>think the complexity of having a mixed pristine collection with some
>files packed and some files unpacked is odd (and some files in SQLite
>and some files on-disk). Maybe end up adding a no-op compression type
>to the file format (IOW, tell gzip to do a no-op inflate via
>Z_NO_COMPRESSION). Maybe. I just doubt it's worth the additional
>complexity though. ("Is this pristine file compressed?" "I don't
>know." Argh!) Making those assumptions based on file extensions or
>even magic bits can be a bit awkward - case in point is PDF...some
>times it'll compress well, some times it won't. So, best off just
>always compressing it. =)
Agreed. I think it's reasonable to attempt at a no-compression type, but keep it abstracted away in the compression layer, not higher. I also agree it's a premature optimization, so we should do it when we have a working stack first.
-Ash
>
>My $.02. -- justin
>
>
>
Re: Compressed Pristines (Summary)
Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
On Wed, Apr 4, 2012 at 1:28 PM, Ashod Nakashian
<as...@yahoo.com> wrote:
> I feel this is indeed what we're closing on, at least for an initial working demo. But I'd like to hear more agreements before committing to this path. I know some did show support for this approach, but it's hard to track them in the noise.
>
> So to make it easier, let's either voice support to this suggestion and commit to an implementation, or voice objection with at least reasons and possibly alternative action. Silence is passive agreement, so the onus on those opposing ;-)
I just read the Google doc - glad to see progress here - a few comments:
First off, if I understand correctly, I do have to say that I'm not at
all a fan of having a large pristine file spread out across multiple
on-disk compressed pack files. I don't think that makes a whole lot
of sense - I think it'd be simplest (when we hit the heuristic to put
it on-disk rather than in SQLite) to keep it to just one file. I
don't get why we'd want to have a big image pristine file (say a PSD
file) split out into say 20 smaller files on disk. Why? It just
seems we're going to introduce a lot of complexity for very little
return. The whole point of stashing the small files directly into
SQLite's pristine.db is to make the small files SQLite's problem and
not the on-disk FS (and reduce sub-block issues) - with that in place,
I think we're not going to need to throw multiple files into the same
pack file. It'll just get too confusing, IMO, to keep track of which
file offsets to use. (For a large file that already hits the size
trigger, we know that - worst case scenario - we might lose one FS
block. Yawn.) We can make the whole strategy simpler if we follow
that.
I'm with Greg in thinking that we don't need the pack index files -
but, I think I'll go further and reiterate that I think that there
should just be a 1:1 correspondence between the pack file and the
pristine file. What's the real advantage of having multiple large
pristines in one pack file (and that we constantly *append* to)? And,
with append FS ops with multiple files in one pack file, we rely on
our WC/FS locking strategy to be 100% perfect or we have a hosed pack
file. Ugh. I think it just adds unnecessary complexity. I think
it'll be far simpler to have 1:1 correspondence with a pack file to a
single large pristine. We'll have enough complexity already to just
find the small files sitting in SQLite rather than on-disk.
Given that 1:1 correspondence, I do think that the original file-size
and the complete checksum should be stored in the custom pack file
on-disk. It'll make it so that we could easily validate whether the
pack file is corrupt or not by using file-size (as a first-order
check) and checksum (as second-order). The thinking here is that if
the checksum is not in the file contents, but only in the file name
(or the pristine.db), the file system could very easily lose the
filename (hello ext3/4!) - this would allow us to verify the integrity
of the pack file and reassociate it if it gets dis-associated. This
is less of an issue with the client as it can always refetch - but, if
the server code ends up using the same on-disk format (as hinted in
the Google Doc)...then, I think this is important to have in the file
format from the beginning.
I definitely think that we should store the full 64-bit length
svn_filesize_t and not be cute and assume no one has a file larger
than 1TB.
I'll disagree with Greg for now and say that it's probably best to
just pack everything and not try to be cute about not packing certain
file types - I think that's a premature optimization right now. I
think the complexity of having a mixed pristine collection with some
files packed and some files unpacked is odd (and some files in SQLite
and some files on-disk). Maybe end up adding a no-op compression type
to the file format (IOW, tell gzip to do a no-op inflate via
Z_NO_COMPRESSION). Maybe. I just doubt it's worth the additional
complexity though. ("Is this pristine file compressed?" "I don't
know." Argh!) Making those assumptions based on file extensions or
even magic bits can be a bit awkward - case in point is PDF...some
times it'll compress well, some times it won't. So, best off just
always compressing it. =)
My $.02. -- justin
Re: Compressed Pristines (Summary)
Posted by Ashod Nakashian <as...@yahoo.com>.
>________________________________
> From: Greg Stein <gs...@gmail.com>
>My vote is compress for files > N bytes (and store on disk), and stick the others into a new pristine.db. Maybe compress before inserting into Sqlite. Not sure. Add a few heuristics for skipping compression on certain files types.
>Shouldn't be too bad to start with that.
>Cheers,
>-g
>
I feel this is indeed what we're closing on, at least for an initial working demo. But I'd like to hear more agreements before committing to this path. I know some did show support for this approach, but it's hard to track them in the noise.
So to make it easier, let's either voice support to this suggestion and commit to an implementation, or voice objection with at least reasons and possibly alternative action. Silence is passive agreement, so the onus on those opposing ;-)
Thanks to all!
-Ash
Re: Compressed Pristines (Summary)
Posted by Ivan Zhakov <iv...@visualsvn.com>.
On Wed, Apr 4, 2012 at 23:54, Greg Stein <gs...@gmail.com> wrote:
>> >
>> >Daniel
>> >(devil's advocate mode)
>
> Given Daniel's devil's advocate position, I say just ignore him. Don't feed
> him :-)
>
> My vote is compress for files > N bytes (and store on disk), and stick the
> others into a new pristine.db. Maybe compress before inserting into Sqlite.
> Not sure. Add a few heuristics for skipping compression on certain files
> types.
>
> Shouldn't be too bad to start with that.
>
+1.
--
Ivan Zhakov
Re: Compressed Pristines (Summary)
Posted by Greg Stein <gs...@gmail.com>.
On Apr 4, 2012 3:26 PM, "Ashod Nakashian" <as...@yahoo.com> wrote:
>
>
>
>
> >________________________________
> > From: Daniel Shahaf <da...@elego.de>
>....
> >>
> >
> >But one _could_ write a filesystem that implements compression and/or
> >deduplication aimed at .svn/pristine/'s workflow. Should effort be
> >spent there rather than on implementing a smarter svn_wc__pristine_*()?
>
> Perhaps we should, but is that a
simpler/easier/more-maintainable/first-try approach that we can defend with
a straight face? I'm having a hard time doing that in my current mode.
>
> >
> >Daniel
> >(devil's advocate mode)
Given Daniel's devil's advocate position, I say just ignore him. Don't feed
him :-)
My vote is compress for files > N bytes (and store on disk), and stick the
others into a new pristine.db. Maybe compress before inserting into Sqlite.
Not sure. Add a few heuristics for skipping compression on certain files
types.
Shouldn't be too bad to start with that.
Cheers,
-g
Re: Compressed Pristines (Summary)
Posted by Ashod Nakashian <as...@yahoo.com>.
>________________________________
> From: Daniel Shahaf <da...@elego.de>
>To: Ashod Nakashian <as...@yahoo.com>
>Cc: Julian Foad <ju...@btopenworld.com>; Markus Schaber <m....@3s-software.com>; "mtherieau@gmail.com" <mt...@gmail.com>; Subversion Development <de...@subversion.apache.org>
>Sent: Wednesday, April 4, 2012 10:46 PM
>Subject: Re: Compressed Pristines (Summary)
>
>Ashod Nakashian wrote on Wed, Apr 04, 2012 at 11:41:43 -0700:
>>
>>
>>
>>
>> ----- Original Message -----
>> > From: Julian Foad <ju...@btopenworld.com>
>> > To: Ashod Nakashian <as...@yahoo.com>
>> > Cc: Daniel Shahaf <da...@elego.de>; Markus Schaber <m....@3s-software.com>; "mtherieau@gmail.com" <mt...@gmail.com>; Subversion Development <de...@subversion.apache.org>
>> > Sent: Wednesday, April 4, 2012 9:45 PM
>> > Subject: Re: Compressed Pristines (Summary)
>> >
>> > Ashod Nakashian wrote:
>> >
>> >> Daniel Shahaf wrote:
>> >>>>> Would you like to assess the feasibility of compressing the
>> > pristine
>> >>>> >store by re-mounting the "pristines" subdirectory as
>> > a compressed
>> >>>> >subtree in the operating system's file system?
>> >>>>
>> >>>> No :-)
>> >>>>
>> >>>> There are two ways to answer this interesting proposition of
>> >>>> compressed file-systems. The obvious one is that it isn't
>> > something
>> >>>> SVN can or should control. The file-system and certainly system
>> >>>> drivers are up to the user and any requirement or suggestion of
>> >>>> tempering with them is decidedly unwarranted and unexpected from
>> >>>> a VCS.
>> >>>
>> >>> The suggestion wasn't that you teach svn how to change the OS's
>> > fs
>> >>> settinsg, it was that you investigate how solutions at the OS level
>> >>> compare to the other approaches already suggested (custom format -based
>> >>> and sqlite-based pristine store).
>> >
>> > Yes, Daniel, that's exactly what I meant. Sorry, Ash, for not being clear
>> > enough.
>> >
>> > Of course that's inherently a non-portable solution that may not be
>> > available on all platforms and certainly will differ. But that's
>> > somewhat analogous to support for password storage: in Windows land
>> > there's a standard way to do it, in Unixy lands you have to choose your
>> > favourite third-party subsystem and externally configure Gnome-keyring or
>> > KDE-wallet or whatever you chose. Of course there are other
>> > disadvantages too, I just think it would be interesting to compare the
>> > disadvantages with the advantages.
>> >
>> >> That's an easy question. The answer is that at *best* they'll do as
>> > good
>> >> as in-place compression. However, in practice they'll do much worse.
>> >
>> > Ash, what's your measure of "best" here -- just the compression
>> > ratio? What about other kinds of goodness such as the automatic recovering of
>> > free space, and the ability to present a plain-text view of the file content
>> > through the standard filesystem API which eliminates the need for us to
>> > implement a plain-text cache in Subversion?
>> >
>> >> The
>> >> reason is that the OS level compression works on not only the single file
>> > level,
>> >> but actually at the block level. This is to make modifications reasonably
>> > fast
>> >> (read compressed data, uncompress, modify, write recompressed data). If the
>> >
>> >> complete file is compressed then even changing a single byte (neglecting
>> > that no
>> >> storage works on the byte-level anyway) will yield performance that will at
>> >
>> >> least linearly degrade by the filesize.
>> >
>> > Changing a single byte is an irrelevant scenario, because pristine files are
>> > always created in full and then never modified.
>>
>> But the OS compression doesn't know that! It's design assumes average
>> file modification operations, and that's rarely replacing the full
>> file (which is the norm for us). I was only explaining and justifying
>> the design decision of OS level compression.
>>
>
>But one _could_ write a filesystem that implements compression and/or
>deduplication aimed at .svn/pristine/'s workflow. Should effort be
>spent there rather than on implementing a smarter svn_wc__pristine_*()?
Perhaps we should, but is that a simpler/easier/more-maintainable/first-try approach that we can defend with a straight face? I'm having a hard time doing that in my current mode.
>
>Daniel
>(devil's advocate mode)
>
>> >
>> >>> In short: if 'mount -o compress=yes' provides 90% space savings
>> > then
>> >> we
>> >>> would have little reason to implement space-saving solutions in svn
>> > itself.
>> >>> But it's the user's, not svn's, responsibility to run that.
>> >
>> > By the way, Daniel, I'm not ruling out the possibility that we may want to
>> > provide some glue logic so that Subversion can help the user to set up the
>> > feature. Without such assistance, only expert users would ever benefit.
>> >
>> > It's clearly an interesting topic!
>> >
>> > - Julian
>> >
>
>
>
Re: Compressed Pristines (Summary)
Posted by Branko Čibej <br...@apache.org>.
On 04.04.2012 20:46, Daniel Shahaf wrote:
> But one _could_ write a filesystem that implements compression and/or
> deduplication aimed at .svn/pristine/'s workflow. Should effort be
> spent there rather than on implementing a smarter svn_wc__pristine_*()?
Now that's an interesting idea. I propose that Ashod immediately drop
his pristine work and instead implement a proof-of-concept, portable
userspace compressed filesystem. I further suggest that the best test
case for the reference implementation might be pristine storage for
Subversion, and in order to lop a few man-years off the proof-of-concept
stage, he might use SQLite for storing filesystem metadata.
Oh wait ... :)
-- Brane
Re: Compressed Pristines (Summary)
Posted by Daniel Shahaf <da...@elego.de>.
Ashod Nakashian wrote on Wed, Apr 04, 2012 at 11:41:43 -0700:
>
>
>
>
> ----- Original Message -----
> > From: Julian Foad <ju...@btopenworld.com>
> > To: Ashod Nakashian <as...@yahoo.com>
> > Cc: Daniel Shahaf <da...@elego.de>; Markus Schaber <m....@3s-software.com>; "mtherieau@gmail.com" <mt...@gmail.com>; Subversion Development <de...@subversion.apache.org>
> > Sent: Wednesday, April 4, 2012 9:45 PM
> > Subject: Re: Compressed Pristines (Summary)
> >
> > Ashod Nakashian wrote:
> >
> >> Daniel Shahaf wrote:
> >>>>> Would you like to assess the feasibility of compressing the
> > pristine
> >>>> >store by re-mounting the "pristines" subdirectory as
> > a compressed
> >>>> >subtree in the operating system's file system?
> >>>>
> >>>> No :-)
> >>>>
> >>>> There are two ways to answer this interesting proposition of
> >>>> compressed file-systems. The obvious one is that it isn't
> > something
> >>>> SVN can or should control. The file-system and certainly system
> >>>> drivers are up to the user and any requirement or suggestion of
> >>>> tempering with them is decidedly unwarranted and unexpected from
> >>>> a VCS.
> >>>
> >>> The suggestion wasn't that you teach svn how to change the OS's
> > fs
> >>> settinsg, it was that you investigate how solutions at the OS level
> >>> compare to the other approaches already suggested (custom format -based
> >>> and sqlite-based pristine store).
> >
> > Yes, Daniel, that's exactly what I meant. Sorry, Ash, for not being clear
> > enough.
> >
> > Of course that's inherently a non-portable solution that may not be
> > available on all platforms and certainly will differ. But that's
> > somewhat analogous to support for password storage: in Windows land
> > there's a standard way to do it, in Unixy lands you have to choose your
> > favourite third-party subsystem and externally configure Gnome-keyring or
> > KDE-wallet or whatever you chose. Of course there are other
> > disadvantages too, I just think it would be interesting to compare the
> > disadvantages with the advantages.
> >
> >> That's an easy question. The answer is that at *best* they'll do as
> > good
> >> as in-place compression. However, in practice they'll do much worse.
> >
> > Ash, what's your measure of "best" here -- just the compression
> > ratio? What about other kinds of goodness such as the automatic recovering of
> > free space, and the ability to present a plain-text view of the file content
> > through the standard filesystem API which eliminates the need for us to
> > implement a plain-text cache in Subversion?
> >
> >> The
> >> reason is that the OS level compression works on not only the single file
> > level,
> >> but actually at the block level. This is to make modifications reasonably
> > fast
> >> (read compressed data, uncompress, modify, write recompressed data). If the
> >
> >> complete file is compressed then even changing a single byte (neglecting
> > that no
> >> storage works on the byte-level anyway) will yield performance that will at
> >
> >> least linearly degrade by the filesize.
> >
> > Changing a single byte is an irrelevant scenario, because pristine files are
> > always created in full and then never modified.
>
> But the OS compression doesn't know that! It's design assumes average
> file modification operations, and that's rarely replacing the full
> file (which is the norm for us). I was only explaining and justifying
> the design decision of OS level compression.
>
But one _could_ write a filesystem that implements compression and/or
deduplication aimed at .svn/pristine/'s workflow. Should effort be
spent there rather than on implementing a smarter svn_wc__pristine_*()?
Daniel
(devil's advocate mode)
> >
> >>> In short: if 'mount -o compress=yes' provides 90% space savings
> > then
> >> we
> >>> would have little reason to implement space-saving solutions in svn
> > itself.
> >>> But it's the user's, not svn's, responsibility to run that.
> >
> > By the way, Daniel, I'm not ruling out the possibility that we may want to
> > provide some glue logic so that Subversion can help the user to set up the
> > feature. Without such assistance, only expert users would ever benefit.
> >
> > It's clearly an interesting topic!
> >
> > - Julian
> >
Re: Compressed Pristines (Summary)
Posted by Daniel Shahaf <da...@elego.de>.
Julian Foad wrote on Wed, Apr 04, 2012 at 18:45:34 +0100:
> Ashod Nakashian wrote:
> > Daniel Shahaf wrote:
> >> In short: if 'mount -o compress=yes' provides 90% space savings
> >> then we would have little reason to implement space-saving
> >> solutions in svn itself. But it's the user's, not svn's,
> >> responsibility to run that.
>
> By the way, Daniel, I'm not ruling out the possibility that we may
> want to provide some glue logic so that Subversion can help the user
> to set up the feature. Without such assistance, only expert users
> would ever benefit.
>
What kind of logic do you have in mind? I imagine that any logic here
would need to run as root and be reasonably system- (and filesystem-)
specific.
> It's clearly an interesting topic!
>
Indeed.
> - Julian
Re: Compressed Pristines (Summary)
Posted by Hyrum K Wright <hy...@wandisco.com>.
On Wed, Apr 4, 2012 at 12:45 PM, Julian Foad <ju...@btopenworld.com> wrote:
> Ashod Nakashian wrote:
>
>> Daniel Shahaf wrote:
>>> In short: if 'mount -o compress=yes' provides 90% space savings then
>> we
>>> would have little reason to implement space-saving solutions in svn itself.
>>> But it's the user's, not svn's, responsibility to run that.
>
> By the way, Daniel, I'm not ruling out the possibility that we may want to provide some glue logic so that Subversion can help the user to set up the feature. Without such assistance, only expert users would ever benefit.
But perhaps only expert users *need* the benefit.
Subversion has always been a system that is easy to deploy and admin,
particularly for the small-shop folks. Those guys are happy to with
reasonable defaults, and expect Subversion to just stay out the way so
they can get Real Work done.
The big shops, the ones with 100GB working copies, are the people who
are most interested in the disk space savings possible from compressed
pristines, because they are the people who stand to benefit the most.
Those folks have the resources to customize their Subversion
installations, and most likely will. They also likely have people
whose *entire job* is to optimize the system, and we should trust them
to do that job, not coddle them.
-Hyrum
--
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/
Re: Compressed Pristines (Summary)
Posted by Ashod Nakashian <as...@yahoo.com>.
----- Original Message -----
> From: Julian Foad <ju...@btopenworld.com>
> To: Ashod Nakashian <as...@yahoo.com>
> Cc: Daniel Shahaf <da...@elego.de>; Markus Schaber <m....@3s-software.com>; "mtherieau@gmail.com" <mt...@gmail.com>; Subversion Development <de...@subversion.apache.org>
> Sent: Wednesday, April 4, 2012 9:45 PM
> Subject: Re: Compressed Pristines (Summary)
>
> Ashod Nakashian wrote:
>
>> Daniel Shahaf wrote:
>>>>> Would you like to assess the feasibility of compressing the
> pristine
>>>> >store by re-mounting the "pristines" subdirectory as
> a compressed
>>>> >subtree in the operating system's file system?
>>>>
>>>> No :-)
>>>>
>>>> There are two ways to answer this interesting proposition of
>>>> compressed file-systems. The obvious one is that it isn't
> something
>>>> SVN can or should control. The file-system and certainly system
>>>> drivers are up to the user and any requirement or suggestion of
>>>> tempering with them is decidedly unwarranted and unexpected from
>>>> a VCS.
>>>
>>> The suggestion wasn't that you teach svn how to change the OS's
> fs
>>> settinsg, it was that you investigate how solutions at the OS level
>>> compare to the other approaches already suggested (custom format -based
>>> and sqlite-based pristine store).
>
> Yes, Daniel, that's exactly what I meant. Sorry, Ash, for not being clear
> enough.
>
> Of course that's inherently a non-portable solution that may not be
> available on all platforms and certainly will differ. But that's
> somewhat analogous to support for password storage: in Windows land
> there's a standard way to do it, in Unixy lands you have to choose your
> favourite third-party subsystem and externally configure Gnome-keyring or
> KDE-wallet or whatever you chose. Of course there are other
> disadvantages too, I just think it would be interesting to compare the
> disadvantages with the advantages.
>
>> That's an easy question. The answer is that at *best* they'll do as
> good
>> as in-place compression. However, in practice they'll do much worse.
>
> Ash, what's your measure of "best" here -- just the compression
> ratio? What about other kinds of goodness such as the automatic recovering of
> free space, and the ability to present a plain-text view of the file content
> through the standard filesystem API which eliminates the need for us to
> implement a plain-text cache in Subversion?
>
>> The
>> reason is that the OS level compression works on not only the single file
> level,
>> but actually at the block level. This is to make modifications reasonably
> fast
>> (read compressed data, uncompress, modify, write recompressed data). If the
>
>> complete file is compressed then even changing a single byte (neglecting
> that no
>> storage works on the byte-level anyway) will yield performance that will at
>
>> least linearly degrade by the filesize.
>
> Changing a single byte is an irrelevant scenario, because pristine files are
> always created in full and then never modified.
But the OS compression doesn't know that! It's design assumes average file modification operations, and that's rarely replacing the full file (which is the norm for us). I was only explaining and justifying the design decision of OS level compression.
>
>>> In short: if 'mount -o compress=yes' provides 90% space savings
> then
>> we
>>> would have little reason to implement space-saving solutions in svn
> itself.
>>> But it's the user's, not svn's, responsibility to run that.
>
> By the way, Daniel, I'm not ruling out the possibility that we may want to
> provide some glue logic so that Subversion can help the user to set up the
> feature. Without such assistance, only expert users would ever benefit.
>
> It's clearly an interesting topic!
>
> - Julian
>
Re: Compressed Pristines (Summary)
Posted by Julian Foad <ju...@btopenworld.com>.
Ashod Nakashian wrote:
> Daniel Shahaf wrote:
>>>> Would you like to assess the feasibility of compressing the pristine
>>> >store by re-mounting the "pristines" subdirectory as a compressed
>>> >subtree in the operating system's file system?
>>>
>>> No :-)
>>>
>>> There are two ways to answer this interesting proposition of
>>> compressed file-systems. The obvious one is that it isn't something
>>> SVN can or should control. The file-system and certainly system
>>> drivers are up to the user and any requirement or suggestion of
>>> tempering with them is decidedly unwarranted and unexpected from
>>> a VCS.
>>
>> The suggestion wasn't that you teach svn how to change the OS's fs
>> settinsg, it was that you investigate how solutions at the OS level
>> compare to the other approaches already suggested (custom format -based
>> and sqlite-based pristine store).
Yes, Daniel, that's exactly what I meant. Sorry, Ash, for not being clear enough.
Of course that's inherently a non-portable solution that may not be
available on all platforms and certainly will differ. But that's
somewhat analogous to support for password storage: in Windows land
there's a standard way to do it, in Unixy lands you have to choose your
favourite third-party subsystem and externally configure Gnome-keyring or KDE-wallet or whatever you chose. Of course there are other
disadvantages too, I just think it would be interesting to compare the
disadvantages with the advantages.
> That's an easy question. The answer is that at *best* they'll do as good
> as in-place compression. However, in practice they'll do much worse.
Ash, what's your measure of "best" here -- just the compression ratio? What about other kinds of goodness such as the automatic recovering of free space, and the ability to present a plain-text view of the file content through the standard filesystem API which eliminates the need for us to implement a plain-text cache in Subversion?
> The
> reason is that the OS level compression works on not only the single file level,
> but actually at the block level. This is to make modifications reasonably fast
> (read compressed data, uncompress, modify, write recompressed data). If the
> complete file is compressed then even changing a single byte (neglecting that no
> storage works on the byte-level anyway) will yield performance that will at
> least linearly degrade by the filesize.
Changing a single byte is an irrelevant scenario, because pristine files are always created in full and then never modified.
>> In short: if 'mount -o compress=yes' provides 90% space savings then
> we
>> would have little reason to implement space-saving solutions in svn itself.
>> But it's the user's, not svn's, responsibility to run that.
By the way, Daniel, I'm not ruling out the possibility that we may want to provide some glue logic so that Subversion can help the user to set up the feature. Without such assistance, only expert users would ever benefit.
It's clearly an interesting topic!
- Julian
Re: Compressed Pristines (Summary)
Posted by Ashod Nakashian <as...@yahoo.com>.
>________________________________
> From: Mark Phippard <ma...@gmail.com>
>To: Ashod Nakashian <as...@yahoo.com>
>Cc: Daniel Shahaf <da...@elego.de>; Markus Schaber <m....@3s-software.com>; "julianfoad@btopenworld.com" <ju...@btopenworld.com>; "mtherieau@gmail.com" <mt...@gmail.com>; Subversion Development <de...@subversion.apache.org>
>Sent: Wednesday, April 4, 2012 9:23 PM
>Subject: Re: Compressed Pristines (Summary)
>
>On Wed, Apr 4, 2012 at 1:18 PM, Ashod Nakashian
><as...@yahoo.com> wrote:
>
>> That's an easy question. The answer is that at *best* they'll do as good as in-place compression. However, in practice
>> they'll do much worse. The reason is that the OS level compression works on not only the single file level, but actually
>> at the block level. This is to make modifications reasonably fast (read compressed data, uncompress, modify, write
>> recompressed data). If the complete file is compressed then even changing a single byte (neglecting that no storage
>> works on the byte-level anyway) will yield performance that will at least linearly degrade by the filesize.
>
>FWIW, that is exactly my concern with your custom file format. I do
>not see how you can achieve the benefits you expect without needing to
>repack files and I do not see how that can perform reasonably.
That's the tricky part of course. To attack this problem we need to strike a balance between pack size and how aggressively we repack to regain wasted "holes". It's not difficult to find a good middle-ground because working with a few MBs is reasonably fast (please see the estimations on size/speed in the proposal) and the waste of a full block is negligible for a file of even 1MB of size. I'm oversimplifying to convey a point: we don't need optimality, we need a practical approach that yields the biggest bang for our buck. And as far as that goes, I'm in agreement with the sentiment of settling for the easiest solution that gets us the farthest. It's just that we haven't yet reached consensus on what that is! :-)
>
>That said, you also seem aware that the solution has to perform well
>so at worst it is just a question as to whether you want to spend the
>cycles to prove it can work and achieve all the goals. I am skeptical
>but look forward to being wrong.
>
>The lazy part of me thinks storing files up to 32KB in SQLite and
>storing the rest as just single compressed files would give 99% of our
>users what they want and would be less likely to have issues.
I have to agree with you here. We just need to get working on having something that can actually work and verified to meet this goal. If we can do that *with decent performance* then we have a clear winner.
-Ash
>
>--
>Thanks
>
>Mark Phippard
>http://markphip.blogspot.com/
>
>
>
Re: Compressed Pristines (Summary)
Posted by Mark Phippard <ma...@gmail.com>.
On Wed, Apr 4, 2012 at 1:18 PM, Ashod Nakashian
<as...@yahoo.com> wrote:
> That's an easy question. The answer is that at *best* they'll do as good as in-place compression. However, in practice
> they'll do much worse. The reason is that the OS level compression works on not only the single file level, but actually
> at the block level. This is to make modifications reasonably fast (read compressed data, uncompress, modify, write
> recompressed data). If the complete file is compressed then even changing a single byte (neglecting that no storage
> works on the byte-level anyway) will yield performance that will at least linearly degrade by the filesize.
FWIW, that is exactly my concern with your custom file format. I do
not see how you can achieve the benefits you expect without needing to
repack files and I do not see how that can perform reasonably.
That said, you also seem aware that the solution has to perform well
so at worst it is just a question as to whether you want to spend the
cycles to prove it can work and achieve all the goals. I am skeptical
but look forward to being wrong.
The lazy part of me thinks storing files up to 32KB in SQLite and
storing the rest as just single compressed files would give 99% of our
users what they want and would be less likely to have issues.
--
Thanks
Mark Phippard
http://markphip.blogspot.com/
Re: Compressed Pristines (Summary)
Posted by Ashod Nakashian <as...@yahoo.com>.
>________________________________
> From: Daniel Shahaf <da...@elego.de>
>To: Ashod Nakashian <as...@yahoo.com>
>Cc: Markus Schaber <m....@3s-software.com>; "julianfoad@btopenworld.com" <ju...@btopenworld.com>; "mtherieau@gmail.com" <mt...@gmail.com>; Subversion Development <de...@subversion.apache.org>
>Sent: Wednesday, April 4, 2012 9:46 AM
>Subject: Re: Compressed Pristines (Summary)
>
>> >1. Filesystem compression.
>> >
>> >Would you like to assess the feasibility of compressing the pristine
>> >store by re-mounting the "pristines" subdirectory as a compressed
>> >subtree in the operating system's file system?
>>
>> No :-)
>>
>> There are two ways to answer this interesting proposition of
>> compressed file-systems. The obvious one is that it isn't something
>> SVN can or should control. The file-system and certainly system
>> drivers are up to the user and any requirement or suggestion of
>> tempering with them is decidedly unwarranted and unexpected from
>> a VCS.
>
>The suggestion wasn't that you teach svn how to change the OS's fs
>settinsg, it was that you investigate how solutions at the OS level
>compare to the other approaches already suggested (custom format -based
>and sqlite-based pristine store).
That's an easy question. The answer is that at *best* they'll do as good as in-place compression. However, in practice they'll do much worse. The reason is that the OS level compression works on not only the single file level, but actually at the block level. This is to make modifications reasonably fast (read compressed data, uncompress, modify, write recompressed data). If the complete file is compressed then even changing a single byte (neglecting that no storage works on the byte-level anyway) will yield performance that will at least linearly degrade by the filesize.
>
>In short: if 'mount -o compress=yes' provides 90% space savings then we
>would have little reason to implement space-saving solutions in svn itself.
>But it's the user's, not svn's, responsibility to run that.
I should kindly disagree here. The user can do that any time, anyway. SVN is trying to improve its pristine store design, not advise users on how best to organize their storage (in general or when using SVN). In addition, I find discriminating against users who don't have that luxury or knowledge to be a bit unfair. At least if are claiming to support the wide range of systems that we do.
-Ash
>
Re: Compressed Pristines (Summary)
Posted by Daniel Shahaf <da...@elego.de>.
> >1. Filesystem compression.
> >
> >Would you like to assess the feasibility of compressing the pristine
> >store by re-mounting the "pristines" subdirectory as a compressed
> >subtree in the operating system's file system?
>
> No :-)
>
> There are two ways to answer this interesting proposition of
> compressed file-systems. The obvious one is that it isn't something
> SVN can or should control. The file-system and certainly system
> drivers are up to the user and any requirement or suggestion of
> tempering with them is decidedly unwarranted and unexpected from
> a VCS.
The suggestion wasn't that you teach svn how to change the OS's fs
settinsg, it was that you investigate how solutions at the OS level
compare to the other approaches already suggested (custom format -based
and sqlite-based pristine store).
In short: if 'mount -o compress=yes' provides 90% space savings then we
would have little reason to implement space-saving solutions in svn itself.
But it's the user's, not svn's, responsibility to run that.
Re: Compressed Pristines (Call for Vote)
Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Julian Foad wrote on Mon, Mar 26, 2012 at 13:00:58 +0100:
> Ashod Nakashian wrote:
> [...]
>
> > *Let's vote on a design and a plan to get us there.* At this point I can
> > only wait for everyone to catch up, do their tests and run their numbers and
> > vote on what they think will best benefit the community in the long run.
> >
We don't vote on design plans around here, we achieve consensus.
> > ::Subversion Compressed Pristines Simulation::
> > Disk block-size is 4096 bytes.
> >
> > Checking out http://svn.apache.org/repos/asf/subversion/trunk/
> > svn: .svn-base is 44730415 bytes in 1882 files, 23767 average file size.
> > Sub-block waste 3942353 (8.81%)
> > svn: .svn-base.GZ is 16044735 bytes in 1882 files, 8525 average gz file size.
> > Sub-block waste 4644161 (28.94%)
> [... pages and pages of numbers :-) ...]
>
> Please summarize all the data you have in just a few lines with only
> 2 significant figures of precision, if you want casual readers such as
> me to be able to make any sense of it!
>
Summarizing the thread might be a good idea, I haven't had time to read
it all and I suspect I'm not alone in that.
> - Julian
Re: Compressed Pristines (Design Doc)
Posted by Branko Čibej <br...@e-reka.si>.
On 26 March 2012 11:53, Ivan Zhakov <iv...@visualsvn.com> wrote:
> 2012/3/25 Branko Čibej <br...@e-reka.si>:
>> On 22.03.2012 17:01, Branko Čibej wrote:
>>> On 22.03.2012 16:50, Daniel Shahaf wrote:
>>>> Branko Čibej wrote on Thu, Mar 22, 2012 at 16:37:24 +0100:
> [..]
>>
>> Based on these observations, it's clear that the implementation should
>> proceed as follows:
>>
>> Step 1: Just compress the pristine files, do not use any packing. This
>> gives a 60% decrease in disk usage in the HTTPD case, but even if the
>> decrease is only 30%, it's still worth the effort.
>>
>> Step 2: Store small (for some definition of "small") compressed pristine
>> files in a SQLite database. In the case of HTTPD, this gives an exter up
>> to 90% savings in disk usage, but this is a very specific test case and
>> it's hard to guess what kind of gain we'd get on average.
>>
> Makes sense for me. In that case we also benefit on performance (in
> case sqlite blob API has acceptable performance)
>
> And IMHO "small" should be really small (up to 4k) to prevent wc.db
> growing in size.
There's no requirement for putting pristines in the wc.db, it can
easily be a different database that's part of the same connection.
More to the point, in order to make using a database worthwhile, the
size limit shouldn't be /too/ low.
With a 4k filesystem block size, files up to 4k in size will have 50%
wasted on average; 8k files will waste 25%; and so on. My test
compared using 8k and 32k limits, and just increasing that limit added
an extra more than 50% space savings (on top of the already huge
savings of storing up-to-8k files in blobs) with no significant
difference in insertion times. (This last makes sense, as sqlite will
flush in multiples of page sizes, so the insertion times are really
proportional to the overall amount of data written. On average YMMV
<disclaimer/>.)
-- Brane
Re: Compressed Pristines (Design Doc)
Posted by Ivan Zhakov <iv...@visualsvn.com>.
2012/3/25 Branko Čibej <br...@e-reka.si>:
> On 22.03.2012 17:01, Branko Čibej wrote:
>> On 22.03.2012 16:50, Daniel Shahaf wrote:
>>> Branko Čibej wrote on Thu, Mar 22, 2012 at 16:37:24 +0100:
[..]
>
> Based on these observations, it's clear that the implementation should
> proceed as follows:
>
> Step 1: Just compress the pristine files, do not use any packing. This
> gives a 60% decrease in disk usage in the HTTPD case, but even if the
> decrease is only 30%, it's still worth the effort.
>
> Step 2: Store small (for some definition of "small") compressed pristine
> files in a SQLite database. In the case of HTTPD, this gives an exter up
> to 90% savings in disk usage, but this is a very specific test case and
> it's hard to guess what kind of gain we'd get on average.
>
Makes sense for me. In that case we also benefit on performance (in
case sqlite blob API has acceptable performance)
And IMHO "small" should be really small (up to 4k) to prevent wc.db
growing in size.
--
Ivan Zhakov
Re: Compressed Pristines (Call for Vote)
Posted by Julian Foad <ju...@btopenworld.com>.
Ashod Nakashian wrote:
[...]
> *Let's vote on a design and a plan to get us there.* At this point I can
> only wait for everyone to catch up, do their tests and run their numbers and
> vote on what they think will best benefit the community in the long run.
>
> ::Subversion Compressed Pristines Simulation::
> Disk block-size is 4096 bytes.
>
> Checking out http://svn.apache.org/repos/asf/subversion/trunk/
> svn: .svn-base is 44730415 bytes in 1882 files, 23767 average file size.
> Sub-block waste 3942353 (8.81%)
> svn: .svn-base.GZ is 16044735 bytes in 1882 files, 8525 average gz file size.
> Sub-block waste 4644161 (28.94%)
[... pages and pages of numbers :-) ...]
Please summarize all the data you have in just a few lines with only 2 significant figures of precision, if you want casual readers such as me to be able to make any sense of it!
- Julian
Re: Compressed Pristines (Summary)
Posted by Julian Foad <ju...@btopenworld.com>.
Hi Ashnod.
1. Filesystem compression.
Would you like to assess the
feasibility of compressing the pristine store by re-mounting the
"pristines" subdirectory as a compressed subtree in the operating
system's file system? This can be done (I believe) under Windows with
NTFS <http://support.microsoft.com/kb/307987> and under Linux with FUSE-compress
<http://code.google.com/p/fusecompress/>. Certainly the
trade-offs are different, compared with implementing compression inside Subversion, but delegating the task to a third-party
subsytem could give us a huge advantage in terms of reducing the ongoing maintenance cost.
2. Uncompressed copies.
There has been a lot of discussion about achieving maximal compression by exploiting properties of similarity, ordering, and so on. That is an interesting topic. However, compression is notthe only thing the pristine store needs to do.
The pristine store implementation also needs to provide *uncompressed* copies of the files. Some of the API consumers can and should read the data through svn_stream_t; this is the easy part. Other API consumers -- primarily those that invoke an external 'diff' tool -- need to be given access to a complete uncompressed file on disk.
At the moment, we just pass them the path to the file in the pristine store. When the pristine file is compressed, I imagine we will need to implement a cache of uncompressed copies of the pristine files. The lifetimes of those uncompressed copies will need to be managed, and this may require some changes to the interface that is used to access them. A typical problem is: user runs "svn diff", svn starts up a GUI diff tool and passes it two paths: the path to an uncompressed copy of a pristine file, and the path of a working-copy file. The GUI tool runs as a separate process and the "svn" process finishes. Now the GUI diff is still running, accessing a file in our uncompressed-pristines cache. How do we manage this so that we don't immediately delete the uncompressed file while the GUI diff is still displaying it, and yet also know when to clean up our cache later?
We could of course declare that the "pristine store" software layer is only responsible for providing streamy read access, and the management of uncompressed copies is the responsibility of higher level code. But no matter where we draw the boundary, that functionality has to be designed and implemented before we can successfully use any kind of compression.
- Julian
>________________________________
> From: Ashod Nakashian <as...@yahoo.com>
>
>In an attempt to reduce the footprint of pristine files in a working copy (WC) the compressed pristines (CP) feature is proposed[1]. There has been discussion and debates regarding the particulars of the proposal. This is a summary of this discussion and consolidation/checkpoint of the thread in preparation to move forward. I tried to keep it short, but there is quite a bit of technical details that are pertinent and should be included for a balanced picture.
>
>::Summary::
>
>The design document[1] outlines rationale behind the feature as well as requirements. So far these weren't challenged. To summarize them:
>
>Pristine files currently incur almost 100%[2] overhead both in terms of disk footprint and file count in a given WC. Since pristine files is a design element of SVN, reducing their inherent overhead should be a welcome improvement to SVN from a user's perspective. Due to the nature of source files that tend to be small, the footprint of a pristine store (PS) is larger on disk than the actual total bytes because of internal fragmentation (file-system block-size rounding waste) - see references for numbers. The proposal takes this into consideration and proposes packing small files together into larger files to reduce this sub-block waste to a minimum. The packing of pristine files introduced a new complication, however, that of efficiently adding and removing pristine files from a pack. The solution was to introduce a minimalist custom file format to support SVN requirements from the ground up. This custom file format has been challenged by many members
>of the community.
>
>::Solutions::
>
>Broadly speaking, there has been 3 proposed designs for the CP feature.
>
>1) In-place compressed files (aka gzipped pristine files).
>2) Custom pack files (split by a cutoff size so large files are practically compressed in-place).
>3) Sqlite database (for small files + files on disk for large ones).
>
>::Observations::
>
>There has been tests and simulations[3][4][5] that attempted to collect hard numbers on the 3 alternatives. The gist of all that can be summarized as follows:
>
>a) Sub-block waste of 10-50% was observed on untouched SVN1.7 checkouts[6].
>b) Sub-block waste increases for in-place compression percentage-wise, limiting the potential savings[7].
>c) In-place compressed files when combined (packed) a *further* 150-500% reduction was obtained [8].
>d) Projects that have a very large number of files (50k+) tend to have a small average size, hence they have the biggest potential to gain from reduced sub-block waste and faster file-reads thanks to packing (reduced disk seeks and improved read cache utilization).
>e) Sqlite has a solid offering that may be used to pack small files easily.
>f) Sqlite may suffer from external fragmentation (holes in the file that aren't used due to deletions) which counterweights the savings by keeping the PS footprint artificially larger than necessary.
>g) Sqlite is *not* suitable for large files (typically anything beyond several dozens of KBs).
>
>::Critique::
>
>1) In-place compression has the flattest technical challenges curve. It's readily available via the compressed streams API in SVN using Zlib. While this is a huge advantage, the reduction in disk space is limited. Tests show that in the best case scenario (one case only) 60% compression wasn't attainable and most cases didn't hit 50% while others were limited to 25%. Packed compression improved these numbers by 150% for the first case and exceeded 500% in the other extreme. In addition, in-place compression will not reduce pressure on the file-system and can't exploit any advantages that the other two proposals do. A minor disadvantage voices is the fact that the pristine files remain transparent to the users and may potentially encourage unsupported manipulations.
>
>2) A custom file format holds the promise of supporting an arbitrary number of requirements, is self-contained, extensibility and flexibility. The implementation may be incrementally improved to add new features and operations that yield improved performance and/or disk savings. Once we have a custom format, we can sort and combine files before compression to exploit inter-file similarities. This is shown to yield significant savings without adding too much complexity (see references for numbers). The major critique of this approach is that of the overhead, risks and complexity associated with implementing and maintaining a custom file format of release grade. If the benefits are doubtful to justify this overhead, then we should forgo going this route.
>
>3) Sqlite has a very reputable code-base and performance, in addition to already being utilized by SVN. A proposal to use it for small pristine file storage has been proposed. The major advantage is the possibility of abusing and/or overloading Sqlite with this kind of usage that it probably isn't optimized to handle. In addition, if the database file increases too much, performance and disk usage may deteriorate and require costly maintenance passes to improve them. Sqlite will not handle large file, which will be stored separately on disk, this is similar to the custom file format case where large files will end up not sharing other files in the pack file they are in.
>
>::Conclusion::
>
>Regardless of what approach we take, it'll most probably feature two properties: incremental implementation and benchmarking. The simplest approach could be taken first, keeping in mind that we need to collect more data and perform rigorous testing to ensure stability and reliability. In-place compression while very easily attainable in implementation, is very limited and will serve only the smaller WC's with large average file-size. Sqlite holds a great promise that should be explored. Where the cutoff for small files are, what page-size should we choose and other Sqlite configuration details that may affect performance is subject to further research. Creating a custom file format that is simple, yet powerful enough to give us flexibility is still a very exciting possibility. One that should probably be explored if for nothing other than research and comparison. Sqlite can be used as a first implementation and the simplest working pack-file
>implementation may be added for comparison and experimentation.
>
>Thank you for reading. Please share your opinion, notes and concerns.
>
>[1] https://docs.google.com/document/d/1ktIsewfMBMVBxbn-Ng8NwkNwAS_QJ6eC7GOygsbBeEc/edit
>[2] Since pristines are stored using SHA-1 hash, identical files are stored only once.
>[3] http://mail-archives.apache.org/mod_mbox/subversion-dev/201203.mbox/%3C1332695820.9245.YahooMailNeo@web161401.mail.bf1.yahoo.com%3E
>[4] http://svn.haxx.se/dev/archive-2012-03/0573.shtml
>
>[5] http://svn.haxx.se/dev/archive-2012-03/0578.shtml
>
>[6] Tested trunks were SVN, GCC, WebKit, OOO and WP late March 2012.
>[7] Files on which compression doesn't reduce them by multiples of block size don't shrink on disk. Therefore, files smaller than a single block can never be shrunk more, even with the best compression algorithms.
>[8] These savings are due to inter-file similarities, sorting (exploits statistical similarities between same-type files) and avoiding sub-block waste. The latter has the biggest effect on WC's with small average file-sizes while sorting has the least effect in the order of single-digit percentage improvement.
>
>-Ash
>
>
>
Re: Compressed Pristines (Summary)
Posted by Ashod Nakashian <as...@yahoo.com>.
Combined response inline...
> From: Markus Schaber <m....@3s-software.com>
>
>First, thanks for your great summary. I'll throw in just my 2 cents below.
The pleasure is mine.
> From: Markus Schaber <m....@3s-software.com>
>
>Was any of those tests actually executed on a file system supporting something like "block suballocation", "tail merging" or "tail packing"?
No, not to my knowledge. Mine was on standard installations of Ubuntu 11.10. And I was trying to calculate the waste on a system that *didn't* have them enabled.
> From: Markus Schaber <m....@3s-software.com>
>
>Today, I was rather surprised that my pristine subdir of one of our main projects which contains 726 MB of data has an actual disk size of 759 MB, which leads to an overhead of less than 4% due to block-size rounding. (According to the Explorer "Properties" dialog of Win 7 on a NTFS file system.)
Did you have NTFS compression enabled?
> From: Markus Schaber <m....@3s-software.com>
>
>AFAICS, "modern" file systems increasingly support that kind of feature[1], so we should at least think about how much effort we want to throw at the "packing" part of the problem if it's likely to vanish (or, at least, being drastically reduced) in the future.
[snip]
> From: Mark Therieau <mt...@gmail.com>
>
>Another thought would be to pursue a FUSE-like approach similar to scord [1][2]
[snip]
> From: Julian Foad <ju...@btopenworld.com>
>
>1. Filesystem compression.
>
>Would you like to assess the feasibility of compressing the pristine store by re-mounting the "pristines" subdirectory as a compressed subtree in the operating system's file system?
No :-)
There are two ways to answer this interesting proposition of compressed file-systems. The obvious one is that it isn't something SVN can or should control. The file-system and certainly system drivers are up to the user and any requirement or suggestion of tempering with them is decidedly unwarranted and unexpected from a VCS.
The second is more relevant, however. The user may *still* enable/use these schemes with or without compressed pristine support. After all, we are only concerned with the pristine store and *not* the working copy. So there is still room for these technologies, if/when the user feels so inclined to utilize them.
So I'd say there is nothing preventing the user from using them, at their responsibility, and get further gains in disk savings while at the same time they are markedly out of scope for compressed pristines feature, if not SVN as a system.
> From: Markus Schaber <m....@3s-software.com>
>
>Additionally, the simple and efficient way of storing the pristines in a SQLite database (one blob per file) also prevents us from exploiting inter-file redundancies during compression, while adding a packing layer on top of sqlite leads to both high complexity and a large average blob size, and large blobs are probably more efficiently handled by the FS directly.
Yes. That's what the proposal I drafted is claiming.
> From: Markus Schaber <m....@3s-software.com>
>
>To cut it short: I'll "take" whatever solution emerges, but my gut feeling tells me that we should use plain files as containers, instead of using sqlite.
>
>The other aspects (grouping similar files into the same container before compression, applying a size limit for containers, and storing uncompressible files in uncompressed containers) are fine as discussed.
>
>I'll try to run some statistics using publicly available projects on an NTFS file system, just for comparision.
>
That would be great. Please share your finds.
> From: Mark Therieau <mt...@gmail.com>
>
>If the full goal is to reduce pressure on the underlying file system in the presence
>of many large working copies (e.g. one per branch) then duplicate pristine contents,
>even with super-awesome compression would not match the space savings of a
>de-duplicated, pristine-aware, copy-on-write file system.
That's assuming there are many duplicates. This is certainly possible, especially with many branches/tags checked out from the same source. But I suspect it's a more common scenario to have a single branch checked out from different repositories. In other words, unless we have solid numbers that there is more savings by de-duplication, the working assumption is that improving a single branch by compression will be more useful to more users. Plus, your suggestion is probably part of the unified pristine store (aka ~/.svn) which is out of scope for compressed pristines.
> From: Julian Foad <ju...@btopenworld.com>
>
>The pristine store implementation also needs to provide
*uncompressed* copies of the files. Some of the API consumers can and
should read the data through svn_stream_t; this is the easy part. Other API consumers -- primarily those that invoke an external 'diff' tool -- need to be given access to a complete uncompressed file on disk.
This is certainly a -minor- complication we'll have to deal with. It's just a technicality, not a show stopper or a problem per-se. The pristine/tmp folder could be cleaned up via svn cleanup, for example, or at different check-points. The worse case scenarios are to either to clutter the disk by too many temp uncompressed pristines or to delete them prematurely and force the user to re-run their last command. These aren't fatal and it's easy to find a middle-ground to handle them.
-Ash
AW: Compressed Pristines (Summary)
Posted by Markus Schaber <m....@3s-software.com>.
Hi, Ashod,
First, thanks for your great summary. I'll throw in just my 2 cents below.
> Von: Ashod Nakashian [mailto:ashodnakashian@yahoo.com]
> Pristine files currently incur almost 100%[2] overhead both in terms of
> disk footprint and file count in a given WC. Since pristine files is a
> design element of SVN, reducing their inherent overhead should be a
> welcome improvement to SVN from a user's perspective. Due to the nature of
> source files that tend to be small, the footprint of a pristine store (PS)
> is larger on disk than the actual total bytes because of internal
> fragmentation (file-system block-size rounding waste) - see references for
> numbers.
Was any of those tests actually executed on a file system supporting something like "block suballocation", "tail merging" or "tail packing"?
Today, I was rather surprised that my pristine subdir of one of our main projects which contains 726 MB of data has an actual disk size of 759 MB, which leads to an overhead of less than 4% due to block-size rounding. (According to the Explorer "Properties" dialog of Win 7 on a NTFS file system.)
AFAICS, "modern" file systems increasingly support that kind of feature[1], so we should at least think about how much effort we want to throw at the "packing" part of the problem if it's likely to vanish (or, at least, being drastically reduced) in the future. My concern is that storing small pristines in their own SQLite database will also bring some overhead that may be in the same magnitude of 4%, due to SQLite Metadata, the necessary primary key column, and indexing.
Additionally, the simple and efficient way of storing the pristines in a SQLite database (one blob per file) also prevents us from exploiting inter-file redundancies during compression, while adding a packing layer on top of sqlite leads to both high complexity and a large average blob size, and large blobs are probably more efficiently handled by the FS directly.
To cut it short: I'll "take" whatever solution emerges, but my gut feeling tells me that we should use plain files as containers, instead of using sqlite.
The other aspects (grouping similar files into the same container before compression, applying a size limit for containers, and storing uncompressible files in uncompressed containers) are fine as discussed.
I'll try to run some statistics using publicly available projects on an NTFS file system, just for comparision.
Best regards
Markus Schaber
[1]: http://msdn.microsoft.com/en-us/library/windows/desktop/ee681827%28v=vs.85%29.aspx claims tail packing support for NTFS. http://en.wikipedia.org/wiki/Block_suballocation claims support for BtrFS, ReiserFS, Reiser4, FreeBSD UFS2. And AFAIR, XFS has a similar feature. Sadly, Ext[2,3,4] are not on that list yet, but rumors claim that Ext4 is to be replaced by BtrFS in the long run.
--
___________________________
We software Automation.
3S-Smart Software Solutions GmbH
Markus Schaber | Developer
Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50
Email: m.schaber@3s-software.com | Web: http://www.3s-software.com
CoDeSys internet forum: http://forum.3s-software.com
Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects
Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915
AW: Compressed Pristines (Summary)
Posted by Markus Schaber <m....@3s-software.com>.
Hi,
Von: Markus Schaber
> [ Speculation was: File-Systems providing tail packing / block ]
> [ suballocation like features may remove the need of the "packing" ]
> [ part of small pristines. ]
> I'll try to run some statistics using publicly available projects on an
> NTFS file system, just for comparision.
I did not yet have time to run that yet, but I found out that NTFS is documented to pack small files only up to around 600 bytes.
And given that the Ext2/3/4 family of file systems does not (and possibly never will) support tail packing, I guess that my argument was junk.
Best regards
Markus Schaber
--
___________________________
We software Automation.
3S-Smart Software Solutions GmbH
Markus Schaber | Developer
Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50
Email: m.schaber@3s-software.com | Web: http://www.3s-software.com
CoDeSys internet forum: http://forum.3s-software.com
Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects
Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915
Re: Compressed Pristines (Summary)
Posted by Ashod Nakashian <as...@yahoo.com>.
Hi,
In an attempt to reduce the footprint of pristine files in a working copy (WC) the compressed pristines (CP) feature is proposed[1]. There has been discussion and debates regarding the particulars of the proposal. This is a summary of this discussion and consolidation/checkpoint of the thread in preparation to move forward. I tried to keep it short, but there is quite a bit of technical details that are pertinent and should be included for a balanced picture.
::Summary::
The design document[1] outlines rationale behind the feature as well as requirements. So far these weren't challenged. To summarize them:
Pristine files currently incur almost 100%[2] overhead both in terms of disk footprint and file count in a given WC. Since pristine files is a design element of SVN, reducing their inherent overhead should be a welcome improvement to SVN from a user's perspective. Due to the nature of source files that tend to be small, the footprint of a pristine store (PS) is larger on disk than the actual total bytes because of internal fragmentation (file-system block-size rounding waste) - see references for numbers. The proposal takes this into consideration and proposes packing small files together into larger files to reduce this sub-block waste to a minimum. The packing of pristine files introduced a new complication, however, that of efficiently adding and removing pristine files from a pack. The solution was to introduce a minimalist custom file format to support SVN requirements from the ground up. This custom file format has been challenged by many members
of the community.
::Solutions::
Broadly speaking, there has been 3 proposed designs for the CP feature.
1) In-place compressed files (aka gzipped pristine files).
2) Custom pack files (split by a cutoff size so large files are practically compressed in-place).
3) Sqlite database (for small files + files on disk for large ones).
::Observations::
There has been tests and simulations[3][4][5] that attempted to collect hard numbers on the 3 alternatives. The gist of all that can be summarized as follows:
a) Sub-block waste of 10-50% was observed on untouched SVN1.7 checkouts[6].
b) Sub-block waste increases for in-place compression percentage-wise, limiting the potential savings[7].
c) In-place compressed files when combined (packed) a *further* 150-500% reduction was obtained [8].
d) Projects that have a very large number of files (50k+) tend to have a small average size, hence they have the biggest potential to gain from reduced sub-block waste and faster file-reads thanks to packing (reduced disk seeks and improved read cache utilization).
e) Sqlite has a solid offering that may be used to pack small files easily.
f) Sqlite may suffer from external fragmentation (holes in the file that aren't used due to deletions) which counterweights the savings by keeping the PS footprint artificially larger than necessary.
g) Sqlite is *not* suitable for large files (typically anything beyond several dozens of KBs).
::Critique::
1) In-place compression has the flattest technical challenges curve. It's readily available via the compressed streams API in SVN using Zlib. While this is a huge advantage, the reduction in disk space is limited. Tests show that in the best case scenario (one case only) 60% compression wasn't attainable and most cases didn't hit 50% while others were limited to 25%. Packed compression improved these numbers by 150% for the first case and exceeded 500% in the other extreme. In addition, in-place compression will not reduce pressure on the file-system and can't exploit any advantages that the other two proposals do. A minor disadvantage voices is the fact that the pristine files remain transparent to the users and may potentially encourage unsupported manipulations.
2) A custom file format holds the promise of supporting an arbitrary number of requirements, is self-contained, extensibility and flexibility. The implementation may be incrementally improved to add new features and operations that yield improved performance and/or disk savings. Once we have a custom format, we can sort and combine files before compression to exploit inter-file similarities. This is shown to yield significant savings without adding too much complexity (see references for numbers). The major critique of this approach is that of the overhead, risks and complexity associated with implementing and maintaining a custom file format of release grade. If the benefits are doubtful to justify this overhead, then we should forgo going this route.
3) Sqlite has a very reputable code-base and performance, in addition to already being utilized by SVN. A proposal to use it for small pristine file storage has been proposed. The major advantage is the possibility of abusing and/or overloading Sqlite with this kind of usage that it probably isn't optimized to handle. In addition, if the database file increases too much, performance and disk usage may deteriorate and require costly maintenance passes to improve them. Sqlite will not handle large file, which will be stored separately on disk, this is similar to the custom file format case where large files will end up not sharing other files in the pack file they are in.
::Conclusion::
Regardless of what approach we take, it'll most probably feature two properties: incremental implementation and benchmarking. The simplest approach could be taken first, keeping in mind that we need to collect more data and perform rigorous testing to ensure stability and reliability. In-place compression while very easily attainable in implementation, is very limited and will serve only the smaller WC's with large average file-size. Sqlite holds a great promise that should be explored. Where the cutoff for small files are, what page-size should we choose and other Sqlite configuration details that may affect performance is subject to further research. Creating a custom file format that is simple, yet powerful enough to give us flexibility is still a very exciting possibility. One that should probably be explored if for nothing other than research and comparison. Sqlite can be used as a first implementation and the simplest working pack-file
implementation may be added for comparison and experimentation.
Thank you for reading. Please share your opinion, notes and concerns.
[1] https://docs.google.com/document/d/1ktIsewfMBMVBxbn-Ng8NwkNwAS_QJ6eC7GOygsbBeEc/edit
[2] Since pristines are stored using SHA-1 hash, identical files are stored only once.
[3] http://mail-archives.apache.org/mod_mbox/subversion-dev/201203.mbox/%3C1332695820.9245.YahooMailNeo@web161401.mail.bf1.yahoo.com%3E
[4] http://svn.haxx.se/dev/archive-2012-03/0573.shtml
[5] http://svn.haxx.se/dev/archive-2012-03/0578.shtml
[6] Tested trunks were SVN, GCC, WebKit, OOO and WP late March 2012.
[7] Files on which compression doesn't reduce them by multiples of block size don't shrink on disk. Therefore, files smaller than a single block can never be shrunk more, even with the best compression algorithms.
[8] These savings are due to inter-file similarities, sorting (exploits statistical similarities between same-type files) and avoiding sub-block waste. The latter has the biggest effect on WC's with small average file-sizes while sorting has the least effect in the order of single-digit percentage improvement.
-Ash
Re: AW: Compressed Pristines (Call for Vote)
Posted by Greg Stein <gs...@gmail.com>.
On Tue, Mar 27, 2012 at 15:29, Branko Čibej <br...@apache.org> wrote:
> On 27.03.2012 17:29, Markus Schaber wrote:
>...
>> That's an easy one: When the compressed file (including gzip-headers etc.) is not smaller than the original file, store it uncompressed. This can be enhanced with some percentage or watermark value (e. G. we need at least a reduction of 42 bytes or 2%).
Actually, I would suggest that any file that has an *original* size of
<8k (or some other cutoff), then it just goes into SQLite. Maybe we
compress it in memory, and store the result (since we can't stream the
compression into a SQLite row).
What I'd like to avoid is compress-first, *then* examining the size.
Especially where that operation takes place on disk.
If we say "oh. larger than 8k. compress streamily onto disk." And
conversely we say, "less than 8k. compress into memory. store in
SQLite."
>...
> There are much better ways, e.g., using file(1) or mime.magic (IIRC we
> already have code for the latter), methods that actually look at the
> file contents. Most compressed file formats will have a well-known
> header, or some other discriminating mark (not file name/extension, I
> might add) that's fairly cheap to check, and is good enough to be at
> least an initial rough filter.
Yup. Please see include/private/svn_magic.h. Stefan dropped that in a
while back.
I'd suggest we use it before *any* compression (whether into memory or
onto disk). We can then hard-code certain mime types that are
compressable (or not). *Maybe* provide some escape hatches via
configuration (but y'll know how I hate more user knobs).
Cheers,
-g
Re: AW: Compressed Pristines (Call for Vote)
Posted by Branko Čibej <br...@apache.org>.
On 27.03.2012 17:29, Markus Schaber wrote:
> Hello, Branko,
>
>> Von: Branko Čibej [mailto:brane@xbc.nu] Im Auftrag von Branko Cibej
>>>> As others have pointed out, the only cases where compression and
>>>> packing may cause trouble is working copies with a lot of binary,
>>>> compressed files (.jars, various image formats, etc.) That's a
>>>> problem that needs solving regardless of the compression algorithm or
>>>> pack format.
>>> This can be handled with a not-compressed flag and storing the data as-
>>> is.
>> You're jumping a couple steps here, the first two obviously being, a),
>> identify which file formats should not be compressed, and b) figure out
>> how to detect such files reasonably reliably.
> That's an easy one: When the compressed file (including gzip-headers etc.) is not smaller than the original file, store it uncompressed. This can be enhanced with some percentage or watermark value (e. G. we need at least a reduction of 42 bytes or 2%).
If you're willing to waste the compression time, yes. We do this on the
server side to find out if it's better to store a given version of a
file as a delta to a previous version, or as a fulltext. I was never too
happy about the price of backing out from a wrong assumption, however.
There are much better ways, e.g., using file(1) or mime.magic (IIRC we
already have code for the latter), methods that actually look at the
file contents. Most compressed file formats will have a well-known
header, or some other discriminating mark (not file name/extension, I
might add) that's fairly cheap to check, and is good enough to be at
least an initial rough filter.
(N.B., this kind of check could, at some later day, be used on the
server to optimize contents storage, too.)
-- Brane
AW: Compressed Pristines (Call for Vote)
Posted by Markus Schaber <m....@3s-software.com>.
Hello, Branko,
> Von: Branko Čibej [mailto:brane@xbc.nu] Im Auftrag von Branko Cibej
> >> As others have pointed out, the only cases where compression and
> >> packing may cause trouble is working copies with a lot of binary,
> >> compressed files (.jars, various image formats, etc.) That's a
> >> problem that needs solving regardless of the compression algorithm or
> >> pack format.
> > This can be handled with a not-compressed flag and storing the data as-
> > is.
> You're jumping a couple steps here, the first two obviously being, a),
> identify which file formats should not be compressed, and b) figure out
> how to detect such files reasonably reliably.
That's an easy one: When the compressed file (including gzip-headers etc.) is not smaller than the original file, store it uncompressed. This can be enhanced with some percentage or watermark value (e. G. we need at least a reduction of 42 bytes or 2%).
(When we use packing, then the difference of the container size with and without the file is to be compared.)
Best regards
Markus Schaber
--
___________________________
We software Automation.
3S-Smart Software Solutions GmbH
Markus Schaber | Developer
Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50
Email: m.schaber@3s-software.com | Web: http://www.3s-software.com
CoDeSys internet forum: http://forum.3s-software.com
Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects
Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915
Re: Compressed Pristines (Call for Vote)
Posted by Branko Čibej <br...@apache.org>.
On 27.03.2012 12:14, Bert Huijben wrote:
> A file that is only keyed by its SHA-1 will never grow or shrink.
Doh. I'm stupid this early in the morning. Of course you're right, this
is a non-issue.
-- Brane
RE: Compressed Pristines (Call for Vote)
Posted by Bert Huijben <be...@qqmail.nl>.
> -----Original Message-----
> From: Branko Čibej [mailto:brane@xbc.nu] On Behalf Of Branko Cibej
> Sent: dinsdag 27 maart 2012 2:56
> To: Subversion Development
> Subject: Re: Compressed Pristines (Call for Vote)
>
> [this should really be on the dev@ list, i mis-addressed my response.]
>
> On 26.03.2012 17:48, Ashod Nakashian wrote:
> >>
> >> I recommended a two-stage approach to the implementation because
> >> (packing and) encrypting the pristines is only half the story, there
> >> are a number of interactions with the rest of the system that need to
> >> be ironed out, and it makes no sense to take on the most complex part
> >> of the storage format first.
> > I see. This isn't what I gathered previously.
>
> I don't /know/ what interactions there are, but it would certainly help
> to find out (by running the test suite with the simplest possible
> compressed-pristine implementation, for example).
>
> >> As others have pointed out, the only cases where compression and
> >> packing may cause trouble is working copies with a lot of binary,
> >> compressed files (.jars, various image formats, etc.) That's a problem
> >> that needs solving regardless of the compression algorithm or pack
> >> format.
> > This can be handled with a not-compressed flag and storing the data as-is.
>
> You're jumping a couple steps here, the first two obviously being, a),
> identify which file formats should not be compressed, and b) figure out
> how to detect such files reasonably reliably. Using svn:mime-type as the
> determinator is not the answer, because I can set that to anything I
> like regardless of actual file contents. My advice here is to
> incorporate the flag in the wc.db, but not do the actual detection and
> special handling in the first release.
>
> > My only issue with the database-as-storage is that it won't work for
> > large files and if we store large files directly on disk, then we'll
> > have to split the storage, which isn't really great.
>
> It is, in fact, really great. Filesystems are typically much better at
> storing large files than any contrived packed-file format. Databases are
> typically much better at storing small files than most filesystems. To
> get the most benefit for the least effort, use both.
>
> > Consider a file just around the cut-off for storing in a database that gets
> moved between the database and disk between modifications that results in the
> file crossing the cut-off.
>
> Then don't make the cutoff a hard limit. For example, if a file is
> already on disk, don't store it in the database until it shrinks to
> below 75% of the limit. Conversely, don't push it out to the filesystem
> until it grows to perhaps even 200% of the limit.
A file that is only keyed by its SHA-1 will never grow or shrink. I don't think we have to discuss this part right now.
We moved away from using a pristine file per working copy file in 1.7 and I don't think we want to move back to that system.
When a file changes it becomes a new file, or we must open a completely new design where we also store just the changes for certain files.
Bert
Re: Compressed Pristines (Call for Vote)
Posted by Branko Čibej <br...@e-reka.si>.
[this should really be on the dev@ list, i mis-addressed my response.]
On 26.03.2012 17:48, Ashod Nakashian wrote:
>>
>> I recommended a two-stage approach to the implementation because
>> (packing and) encrypting the pristines is only half the story, there
>> are a number of interactions with the rest of the system that need to
>> be ironed out, and it makes no sense to take on the most complex part
>> of the storage format first.
> I see. This isn't what I gathered previously.
I don't /know/ what interactions there are, but it would certainly help
to find out (by running the test suite with the simplest possible
compressed-pristine implementation, for example).
>> As others have pointed out, the only cases where compression and
>> packing may cause trouble is working copies with a lot of binary,
>> compressed files (.jars, various image formats, etc.) That's a problem
>> that needs solving regardless of the compression algorithm or pack
>> format.
> This can be handled with a not-compressed flag and storing the data as-is.
You're jumping a couple steps here, the first two obviously being, a),
identify which file formats should not be compressed, and b) figure out
how to detect such files reasonably reliably. Using svn:mime-type as the
determinator is not the answer, because I can set that to anything I
like regardless of actual file contents. My advice here is to
incorporate the flag in the wc.db, but not do the actual detection and
special handling in the first release.
> My only issue with the database-as-storage is that it won't work for
> large files and if we store large files directly on disk, then we'll
> have to split the storage, which isn't really great.
It is, in fact, really great. Filesystems are typically much better at
storing large files than any contrived packed-file format. Databases are
typically much better at storing small files than most filesystems. To
get the most benefit for the least effort, use both.
> Consider a file just around the cut-off for storing in a database that gets moved between the database and disk between modifications that results in the file crossing the cut-off.
Then don't make the cutoff a hard limit. For example, if a file is
already on disk, don't store it in the database until it shrinks to
below 75% of the limit. Conversely, don't push it out to the filesystem
until it grows to perhaps even 200% of the limit.
> It's not as clean as having a file-format that handles all cases for us. Sure it'll take longer to get release-quality code, but
But?
> it'd be the correct way of doing things,
Oh nonsense. "Correct" is what works best in a given situation and is
most maintainable, not what generates the best research papers.
> won't feel hackish and will serve us in the long-run better.
I dislike hand-waving arguments, so you'll have to substantiate this one
about serving us better in the long run to convince me. All I see here
is an acute case of NIH syndrome.
> My only similar solid example is Git. I don't know how much effort went into their system, but I'm sure we can do this and do it right. If I were to choose between 6 months to release without packed-files and 12-15 months with them, I'd choose the latter. At least that's how I see it.
The point is that you can have a working, stable implementation using
off-the-shelf code (filesystem and database) in a few weeks, and it does
not stop you from going on to inventing a packed-file format that is
nevertheless friendly to deletions.
(Just for the record though: If you can do that and make it perform
better than SQLite in less than a year, I'll eat my hat.)
-- Brane
Re: Compressed Pristines (Call for Vote)
Posted by Ashod Nakashian <as...@yahoo.com>.
I don't know how I missed this mail, but I have. Thanks to Ivan for bringing it to my attention. Please see inline.
----- Original Message -----
> From: Branko Čibej <br...@e-reka.si>
> To: dev@subversion.apache.org
> Cc:
> Sent: Sunday, March 25, 2012 4:02 AM
> Subject: Re: Compressed Pristines (Design Doc)
>
> On 22.03.2012 17:01, Branko Čibej wrote:
>> On 22.03.2012 16:50, Daniel Shahaf wrote:
>>> Branko Čibej wrote on Thu, Mar 22, 2012 at 16:37:24 +0100:
>>>> It's called SQLite.
>>> Heh. I wondered whether I should mention that the server uses BDB to
>>> store pristine files. (yes, the situation there is different in
>>> several relevant ways)
>> To clarify: I'm /not/ advocating that we store each and every file into
>> an SQLite BLOB. Files larger than several block sizes would be better
>> off on disk as real files (the compressor can, e.g., buffer compressed
>> contents up to, say, 32k, and if they become larger, spill directly into
>> a file; otherwise, dump into a BLOB). If we don't care about shared
>> pristine store, we don't even need a separate database, these blobs can
>> go into wc.db (which, as Greg points out, also serves as an index).
>>
>
> Since we need a few datapoints, I made a quick test to see what kind of
> space savings we can get with SQLite. Note that I've not tried any
> auto-vacuum settings, because my test only does insertions.
>
> I used a checkout of the current HTTPD trunk for my data set, and
> compressed all pristines, then moved them into a SQLite database
> depending on size; first, all compressed files 8k or smaller, next, all
> compressed files 32k or smaller. Note that my script does not prune
> empty directories from the pristine fanout. Here's the log:
>
> brane@zulu:~/src/httpd$ svn co http://svn.apache.org/repos/asf/httpd/httpd/trunk
> [...]
> U trunk
> Checked out revision 1305001.
> brane@zulu:~/src/httpd$ find trunk/.svn/pristine -type f | wc -l
> 3114
> brane@zulu:~/src/httpd$ du -sh trunk/.svn/pristine/
> 42M trunk/.svn/pristine/
> time gzip `find ./trunk/.svn/pristine -name '*.svn-base'`
>
> real 0m14.569s
> user 0m1.282s
> sys 0m0.747s
> brane@zulu:~/src/httpd$ du -sh trunk/.svn/pristine/
> 17M trunk/.svn/pristine/
> brane@zulu:~/src/httpd$ find trunk/.svn/pristine -size -8k -type f | wc -l
> 2856
> #
> # N.B.: 8k max size per blob
> #
> brane@zulu:~/src/httpd$ time python pristine.py trunk/.svn/pristine/
>
> real 0m29.683s
> user 0m0.533s
> sys 0m1.641s
> brane@zulu:~/src/httpd$ du -sh trunk/.svn/pristine/
> 4.7M trunk/.svn/pristine/
> brane@zulu:~/src/httpd$ ll trunk/.svn/pristine//pristine.db
> -rw-r--r-- 1 brane staff 322560 Mar 25 12:43 ps/pristine.db
> #
> # N.B.: 32k max size per blob
> #
> brane@zulu:~/src/httpd$ time python pristine.py trunk/.svn/pristine/
>
> real 0m23.831s
> user 0m0.529s
> sys 0m1.616s
> brane@zulu:~/src/httpd$ du -sh trunk/.svn/pristine/
> 1.2M trunk/.svn/pristine/
>
>
> The pristine.py script is attached.
>
> Based on these observations, it's clear that the implementation should
> proceed as follows:
>
> Step 1: Just compress the pristine files, do not use any packing. This
> gives a 60% decrease in disk usage in the HTTPD case, but even if the
> decrease is only 30%, it's still worth the effort.
>
> Step 2: Store small (for some definition of "small") compressed
> pristine
> files in a SQLite database. In the case of HTTPD, this gives an exter up
> to 90% savings in disk usage, but this is a very specific test case and
> it's hard to guess what kind of gain we'd get on average.
>
> All in all, looking at these number, there's a /looong/ way to go before
> we start playing with custom pack formats and compression of packed
> similar files. I'm not at all sure we'll ever really need the potential
> space savings of these methods, especially compared to the obvious risk
> to WC stability that writing and testing such code obviously brings.
Please see the numbers based on my simulation. I haven't ran HTTPD, but I suspect it'll yield results similar to that of SVN trunk. The simulation shows what gains there are if we use a custom pack file, as opposed to other approaches. The purpose is to avoid stipulation and have concrete figures. As such, and with this advantage at hand, I propose we make a final decision. There is no reason to implement in-place compression for "a while" and then move to packed files (similar to Git's experience) when we know before hand if it'd be worthwhile to pack or not. I don't mind implementing things in stages and with good testing at the end of each, but I'd be less inclined to release such intermediate stages to the public and similarly I'd be less encouraged to re-implement later to improve things when we can decide now with the same confidence as any other time, given the data we've already collected. If packing doesn't yield enough savings to warrant it,
then let's abandon it and never look back.
As such, I'd like to ask you to review your conclusion based on the following numbers. In particular, I'd like to point your attention at the larger projects (GCC, WebKit and OO) where the number of small files is truly large and will make wc.db rather large and bloated (actually, average file-size in the simulated projects is less than 8KB with the exception of SVN. GCC is less than 2KB after compression!). I don't know how typical these projects are.
Finally, I'd like to call on the community to vote on a design. It's a topic that has been discussed on and off for almost a decade. There is no doubt that it's a feature many look forward to, but we should not over design it and bloat our codebase. Having said that, I think it's fair to say we have much more information and data at this point to make a very educated judgment, if I may say so myself. Branko's sqlite python script combined with my bash simulation can really create something very close to a real implementation with mix-n-match of the schemes suggested and discussed.
*Let's vote on a design and a plan to get us there.* At this point I can only wait for everyone to catch up, do their tests and run their numbers and vote on what they think will best benefit the community in the long run.
::Subversion Compressed Pristines Simulation::
Disk block-size is 4096 bytes.
Checking out http://svn.apache.org/repos/asf/subversion/trunk/
svn: .svn-base is 44730415 bytes in 1882 files, 23767 average file size. Sub-block waste 3942353 (8.81%)
svn: .svn-base.GZ is 16044735 bytes in 1882 files, 8525 average gz file size. Sub-block waste 4644161 (28.94%)
svn: .svn-base.BZ2 is 15146221 bytes in 1882 files, 8047 average bzip2 file size. Sub-block waste 4563731 (30.13%)
svn: .svn-base.GZ saves 27983872 bytes, .svn-base.BZ2 saves 28962816 bytes (57.49% and 59.50%) respectively.
svn: .svn-base is 48672768 bytes on disk, .svn-base.GZ is 20688896 bytes on disk, .svn-text.BZ2 is 19709952 bytes on disk.
svn:
GZ Pack is 14295040 bytes on disk, BZ2 Pack is 13062144 bytes on disk.
Saved 34377728 and 35610624 bytes (70.63% and 73.16%) respectively.
svn: GZ pack saves 6393856 bytes (69.09%) compared to .svn-base.GZ.
svn: BZ2 pack saves 6647808 bytes (66.27%) compared to .svn-base.BZ2.
svn:
GZ Sorted Pack is 13832192 bytes on disk, BZ2 Sorted Pack is 12128256
bytes on disk. Saved 34840576 and 36544512 bytes (71.58% and 75.08%)
respectively.
svn: pristine files: 48672768 bytes on disk.
svn: in-place gz: 20688896 bytes (42.50% of original)
svn: in-place bz2: 19709952 bytes (40.49% of original)
svn: packed gz: 14295040 bytes (29.36% of original)
svn: packed bz2: 13062144 bytes (26.83% of original)
svn: sorted packed gz: 13832192 bytes (28.41% of original)
svn: sorted packed bz2: 12128256 bytes (24.91% of original)
Checking out svn://gcc.gnu.org/svn/gcc/trunk
gcc: .svn-base is 444058945 bytes in 75223 files, 5903 average file size. Sub-block waste 217023167 (48.87%)
gcc: .svn-base.GZ is 137009307 bytes in 75223 files, 1821 average gz file size. Sub-block waste 247084901 (180.34%)
gcc: .svn-base.BZ2 is 127560017 bytes in 75223 files, 1695 average bzip2 file size. Sub-block waste 246343343 (193.11%)
gcc: .svn-base.GZ saves 276987904 bytes, .svn-base.BZ2 saves 287178752 bytes (41.89% and 43.44%) respectively.
gcc: .svn-base is 661082112 bytes on disk, .svn-base.GZ is 384094208 bytes on disk, .svn-text.BZ2 is 373903360 bytes on disk.
gcc:
GZ Pack is 109268992 bytes on disk, BZ2 Pack is 91897856 bytes on disk.
Saved 551813120 and 569184256 bytes (83.47% and 86.09%) respectively.
gcc: GZ pack saves 274825216 bytes (28.44%) compared to .svn-base.GZ.
gcc: BZ2 pack saves 282005504 bytes (24.57%) compared to .svn-base.BZ2.
gcc:
GZ Sorted Pack is 94666752 bytes on disk, BZ2 Sorted Pack is 73170944
bytes on disk. Saved 566415360 and 587911168 bytes (85.68% and 88.93%)
respectively.
gcc: pristine files: 661082112 bytes on disk.
gcc: in-place gz: 384094208 bytes (58.10% of original)
gcc: in-place bz2: 373903360 bytes (56.55% of original)
gcc: packed gz: 109268992 bytes (16.52% of original)
gcc: packed bz2: 91897856 bytes (13.90% of original)
gcc: sorted packed gz: 94666752 bytes (14.31% of original)
gcc: sorted packed bz2: 73170944 bytes (11.06% of original)
Checking out http://svn.webkit.org/repository/webkit/trunk
webkit: .svn-base is 1752698337 bytes in 153298 files, 11433 average file size. Sub-block waste 385610271 (22.00%)
webkit: .svn-base.GZ is 1142138194 bytes in 153298 files, 7450 average gz file size. Sub-block waste 456489646 (39.96%)
webkit: .svn-base.BZ2 is 1159101266 bytes in 153298 files, 7561 average bzip2 file size. Sub-block waste 455017646 (39.25%)
webkit: .svn-base.GZ saves 539680768 bytes, .svn-base.BZ2 saves 524189696 bytes (25.23% and 24.51%) respectively.
webkit:
.svn-base is 2138308608 bytes on disk, .svn-base.GZ is 1598627840 bytes
on disk, .svn-text.BZ2 is 1614118912 bytes on disk.
webkit:
GZ Pack is 1112465408 bytes on disk, BZ2 Pack is 1098600448 bytes on
disk. Saved 1025843200 and 1039708160 bytes (47.97% and 48.62%)
respectively.
webkit: GZ pack saves 486162432 bytes (69.58%) compared to .svn-base.GZ.
webkit: BZ2 pack saves 515518464 bytes (68.06%) compared to .svn-base.BZ2.
webkit:
GZ Sorted Pack is 1178726400 bytes on disk, BZ2 Sorted Pack is
1093103616 bytes on disk. Saved 959582208 and 1045204992 bytes (44.87%
and 48.87%) respectively.
webkit: pristine files: 2138308608 bytes on disk.
webkit: in-place gz: 1598627840 bytes (74.76% of original)
webkit: in-place bz2: 1614118912 bytes (75.48% of original)
webkit: packed gz: 1112465408 bytes (52.02% of original)
webkit: packed bz2: 1098600448 bytes (51.37% of original)
webkit: sorted packed gz: 1178726400 bytes (55.12% of original)
webkit: sorted packed bz2: 1093103616 bytes (51.12% of original)
Checking out https://svn.apache.org/repos/asf/incubator/ooo/trunk
svn: E175002: REPORT of '/repos/asf/!svn/me': Could not read response body: Secure connection truncated (https://svn.apache.org)
ooo: .svn-base is 963601263 bytes in 61880 files, 15572 average file size. Sub-block waste 144469137 (14.99%)
ooo: .svn-base.GZ is 458977742 bytes in 61880 files, 7417 average gz file size. Sub-block waste 172936754 (37.67%)
ooo: .svn-base.BZ2 is 457007742 bytes in 61880 files, 7385 average bzip2 file size. Sub-block waste 170614146 (37.33%)
ooo: .svn-base.GZ saves 476155904 bytes, .svn-base.BZ2 saves 480448512 bytes (42.97% and 43.35%) respectively.
ooo: .svn-base is 1108070400 bytes on disk, .svn-base.GZ is 631914496 bytes on disk, .svn-text.BZ2 is 627621888 bytes on disk.
ooo:
GZ Pack is 429735936 bytes on disk, BZ2 Pack is 418869248 bytes on
disk. Saved 678334464 and 689201152 bytes (61.21% and 62.19%)
respectively.
ooo: GZ pack saves 202178560 bytes (68.00%) compared to .svn-base.GZ.
ooo: BZ2 pack saves 208752640 bytes (66.73%) compared to .svn-base.BZ2.
ooo:
GZ Sorted Pack is 413577216 bytes on disk, BZ2 Sorted Pack is 381874176
bytes on disk. Saved 694493184 and 726196224 bytes (62.67% and 65.53%)
respectively.
ooo: pristine files: 1108070400 bytes on disk.
ooo: in-place gz: 631914496 bytes (57.02% of original)
ooo: in-place bz2: 627621888 bytes (56.64% of original)
ooo: packed gz: 429735936 bytes (38.78% of original)
ooo: packed bz2: 418869248 bytes (37.80% of original)
ooo: sorted packed gz: 413577216 bytes (37.32% of original)
ooo: sorted packed bz2: 381874176 bytes (34.46% of original)
Checking out http://core.svn.wordpress.org/trunk/
wo: .svn-base is 11802194 bytes in 957 files, 12332 average file size. Sub-block waste 2341294 (19.83%)
wo: .svn-base.GZ is 5203459 bytes in 957 files, 5437 average gz file size. Sub-block waste 2542077 (48.85%)
wo: .svn-base.BZ2 is 5122614 bytes in 957 files, 5352 average bzip2 file size. Sub-block waste 2512330 (49.04%)
wo: .svn-base.GZ saves 6397952 bytes, .svn-base.BZ2 saves 6508544 bytes (45.23% and 46.01%) respectively.
wo: .svn-base is 14143488 bytes on disk, .svn-base.GZ is 7745536 bytes on disk, .svn-text.BZ2 is 7634944 bytes on disk.
wo:
GZ Pack is 4124672 bytes on disk, BZ2 Pack is 3801088 bytes on disk.
Saved 10018816 and 10342400 bytes (70.83% and 73.12%) respectively.
wo: GZ pack saves 3620864 bytes (53.25%) compared to .svn-base.GZ.
wo: BZ2 pack saves 3833856 bytes (49.78%) compared to .svn-base.BZ2.
wo:
GZ Sorted Pack is 3842048 bytes on disk, BZ2 Sorted Pack is 3493888
bytes on disk. Saved 10301440 and 10649600 bytes (72.83% and 75.29%)
respectively.
wo: pristine files: 14143488 bytes on disk.
wo: in-place gz: 7745536 bytes (54.76% of original)
wo: in-place bz2: 7634944 bytes (53.98% of original)
wo: packed gz: 4124672 bytes (29.16% of original)
wo: packed bz2: 3801088 bytes (26.87% of original)
wo: sorted packed gz: 3842048 bytes (27.16% of original)
wo: sorted packed bz2: 3493888 bytes (24.70% of original)
Cheers,
Ash
>
> Anyway, it's certain that creating this packed format is /not/ the first
> step to take.
>
> -- Brane
>
Re: Compressed Pristines (Design Doc)
Posted by Branko Čibej <br...@e-reka.si>.
On 22.03.2012 17:01, Branko Čibej wrote:
> On 22.03.2012 16:50, Daniel Shahaf wrote:
>> Branko Čibej wrote on Thu, Mar 22, 2012 at 16:37:24 +0100:
>>> It's called SQLite.
>> Heh. I wondered whether I should mention that the server uses BDB to
>> store pristine files. (yes, the situation there is different in
>> several relevant ways)
> To clarify: I'm /not/ advocating that we store each and every file into
> an SQLite BLOB. Files larger than several block sizes would be better
> off on disk as real files (the compressor can, e.g., buffer compressed
> contents up to, say, 32k, and if they become larger, spill directly into
> a file; otherwise, dump into a BLOB). If we don't care about shared
> pristine store, we don't even need a separate database, these blobs can
> go into wc.db (which, as Greg points out, also serves as an index).
>
Since we need a few datapoints, I made a quick test to see what kind of
space savings we can get with SQLite. Note that I've not tried any
auto-vacuum settings, because my test only does insertions.
I used a checkout of the current HTTPD trunk for my data set, and
compressed all pristines, then moved them into a SQLite database
depending on size; first, all compressed files 8k or smaller, next, all
compressed files 32k or smaller. Note that my script does not prune
empty directories from the pristine fanout. Here's the log:
brane@zulu:~/src/httpd$ svn co http://svn.apache.org/repos/asf/httpd/httpd/trunk
[...]
U trunk
Checked out revision 1305001.
brane@zulu:~/src/httpd$ find trunk/.svn/pristine -type f | wc -l
3114
brane@zulu:~/src/httpd$ du -sh trunk/.svn/pristine/
42M trunk/.svn/pristine/
time gzip `find ./trunk/.svn/pristine -name '*.svn-base'`
real 0m14.569s
user 0m1.282s
sys 0m0.747s
brane@zulu:~/src/httpd$ du -sh trunk/.svn/pristine/
17M trunk/.svn/pristine/
brane@zulu:~/src/httpd$ find trunk/.svn/pristine -size -8k -type f | wc -l
2856
#
# N.B.: 8k max size per blob
#
brane@zulu:~/src/httpd$ time python pristine.py trunk/.svn/pristine/
real 0m29.683s
user 0m0.533s
sys 0m1.641s
brane@zulu:~/src/httpd$ du -sh trunk/.svn/pristine/
4.7M trunk/.svn/pristine/
brane@zulu:~/src/httpd$ ll trunk/.svn/pristine//pristine.db
-rw-r--r-- 1 brane staff 322560 Mar 25 12:43 ps/pristine.db
#
# N.B.: 32k max size per blob
#
brane@zulu:~/src/httpd$ time python pristine.py trunk/.svn/pristine/
real 0m23.831s
user 0m0.529s
sys 0m1.616s
brane@zulu:~/src/httpd$ du -sh trunk/.svn/pristine/
1.2M trunk/.svn/pristine/
The pristine.py script is attached.
Based on these observations, it's clear that the implementation should
proceed as follows:
Step 1: Just compress the pristine files, do not use any packing. This
gives a 60% decrease in disk usage in the HTTPD case, but even if the
decrease is only 30%, it's still worth the effort.
Step 2: Store small (for some definition of "small") compressed pristine
files in a SQLite database. In the case of HTTPD, this gives an exter up
to 90% savings in disk usage, but this is a very specific test case and
it's hard to guess what kind of gain we'd get on average.
All in all, looking at these number, there's a /looong/ way to go before
we start playing with custom pack formats and compression of packed
similar files. I'm not at all sure we'll ever really need the potential
space savings of these methods, especially compared to the obvious risk
to WC stability that writing and testing such code obviously brings.
Anyway, it's certain that creating this packed format is /not/ the first
step to take.
-- Brane
Re: Compressed Pristines (Design Doc)
Posted by Branko Čibej <br...@apache.org>.
On 22.03.2012 16:50, Daniel Shahaf wrote:
> Branko Čibej wrote on Thu, Mar 22, 2012 at 16:37:24 +0100:
>> It's called SQLite.
> Heh. I wondered whether I should mention that the server uses BDB to
> store pristine files. (yes, the situation there is different in
> several relevant ways)
To clarify: I'm /not/ advocating that we store each and every file into
an SQLite BLOB. Files larger than several block sizes would be better
off on disk as real files (the compressor can, e.g., buffer compressed
contents up to, say, 32k, and if they become larger, spill directly into
a file; otherwise, dump into a BLOB). If we don't care about shared
pristine store, we don't even need a separate database, these blobs can
go into wc.db (which, as Greg points out, also serves as an index).
-- Brane
Re: Compressed Pristines (Design Doc)
Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Branko Čibej wrote on Thu, Mar 22, 2012 at 16:37:24 +0100:
> It's called SQLite.
Heh. I wondered whether I should mention that the server uses BDB to
store pristine files. (yes, the situation there is different in
several relevant ways)
AW: Compressed Pristines (Design Doc)
Posted by Markus Schaber <m....@3s-software.com>.
Hi, Erik,
Von: Erik Huelsmann [mailto:ehuels@gmail.com]
> To substantiate that claim, I took the pristines directory from my Subversion working copy and did some experimenting. See results below:
> $ ls -ls uncompressed-pristines/*/*.svn-base | awk '{ tot += $1; } END { print "total size " tot; }'
total size: 188724
> $ cp -Rp uncompressed-pristines/ compressed-pristines
> $ gzip compressed-pristines/*/*.svn-base
> $ ls -ls compressed-pristines/*/*.svn-base.gz | awk '{ tot += $1; } END { print "total size " tot; }'
total size: 52320
> $ cat compressed-pristines/*/*.svn-base.gz > combined-compressed-file
Are you sure you should not combine the uncompressed pristines, and compress them afterwards? AFAICS, one of the points of the proposal is to profit from the inter-file redundancies.
Mit freundlichen Grüßen
Markus Schaber
--
___________________________
We software Automation.
3S-Smart Software Solutions GmbH
Markus Schaber | Entwicklung
Memminger Str. 151 | 87439 Kempten | Tel. +49-831-54031-0 | Fax +49-831-54031-50
Email: m.schaber@3s-software.com | Web: http://www.3s-software.com
CoDeSys Internet-Forum: http://forum.3s-software.com
Geschäftsführer: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Handelsregister: Kempten HRB 6186 | USt-IDNr.: DE 167014915
Re: Compressed Pristines (Custom Format?)
Posted by Ben Smith-Mannschott <bs...@gmail.com>.
On Fri, Mar 23, 2012 at 11:32, Greg Stein <gs...@gmail.com> wrote:
>
> On Mar 23, 2012 5:59 AM, "Ben Smith-Mannschott" <bs...@gmail.com>
> wrote:
>>
>> On Fri, Mar 23, 2012 at 10:22, Ashod Nakashian <as...@yahoo.com>
>> wrote:
>>...
>
>> > Now, does this justify the cost of a new file-format? That's reasonable
>> > to argue. My take is that the proposed file-format is simple enough and the
>> > gains (especially on large projects with many branches/tags checked) should
>> > justify this overhead.
>>
>> It seems to me that these are the same issues that drove the design of
>> git's repository format, where individual items are first stored
>> individually gzipped (loose) and then periodically combined into
>> efficient pack files to save additional space and file system
>> overhead.
>>
>> Why invent a new format, when one exists that could serve?
>
> Please read Ash's document. He already considered and covered the git pack
> file format.
thanks. my bad.
Re: Compressed Pristines (Custom Format?)
Posted by Greg Stein <gs...@gmail.com>.
On Mar 23, 2012 5:59 AM, "Ben Smith-Mannschott" <bs...@gmail.com>
wrote:
>
> On Fri, Mar 23, 2012 at 10:22, Ashod Nakashian <as...@yahoo.com>
wrote:
>...
> > Now, does this justify the cost of a new file-format? That's reasonable
to argue. My take is that the proposed file-format is simple enough and the
gains (especially on large projects with many branches/tags checked) should
justify this overhead.
>
> It seems to me that these are the same issues that drove the design of
> git's repository format, where individual items are first stored
> individually gzipped (loose) and then periodically combined into
> efficient pack files to save additional space and file system
> overhead.
>
> Why invent a new format, when one exists that could serve?
Please read Ash's document. He already considered and covered the git pack
file format.
-g
Re: Compressed Pristines (Custom Format?)
Posted by Ben Smith-Mannschott <bs...@gmail.com>.
On Fri, Mar 23, 2012 at 10:22, Ashod Nakashian <as...@yahoo.com> wrote:
> The design's fundamental assumption is that source files are typically smaller than a typical FS block (after compression). Eric and Philip have ran tests on SVN and GCC respectively with different results. I do not have hard-figures because it's near impossible to define "a typical project". However, let me point out the rationale behind this argument:
>
> 1. We don't care as much about file sizes before compression as we do *after* compression (with better compression, more files should fall into the sub-block size, which depends on the FS config, after compression).
> 2. Compressed file-size is highly dependent on the compression algorithm (we should use the best compression that meets our reqs).
> 3. Combining files *before* compression in many cases yield better compression, especially if multiple tags/branches are involved.[1]
> 4. Projects that have "small" files will suffer more by the wasted
> sub-block space especially when multiple tags/branches are checked out
> (typical for active maintainers).
> 5. Reducing the number of files on disk can improve overall disk performance (for very large projects).[2]
> 6. Flexibility, extensibility and opaqueness.
>
> The gist of the above is that if we choose a better-than-gz compression and combine the files both *before* and *after* compression, we'll have much more significant results than what we have now just with gz on individual files. This can be noticed using tar.bz2, for example, where the result is not unlike what we can achieve with the custom file format (although bz2 is probably too slow for our needs).
>
> Now, does this justify the cost of a new file-format? That's reasonable to argue. My take is that the proposed file-format is simple enough and the gains (especially on large projects with many branches/tags checked) should justify this overhead.
It seems to me that these are the same issues that drove the design of
git's repository format, where individual items are first stored
individually gzipped (loose) and then periodically combined into
efficient pack files to save additional space and file system
overhead.
Why invent a new format, when one exists that could serve?
Engineering problems are all about trade-offs, so I'd be remiss in not
mentioning the obvious down-side of using git's approach: (1)
unpredictable runtimes of individual svn commands, because they may
occasionally choose to initiate a repacking or (2) a manual 'repack'
command that a user can run when convenient.
// Ben
Re: AW: AW: Compressed Pristines (Custom Format?)
Posted by Ashod Nakashian <as...@yahoo.com>.
----- Original Message -----
> From: Markus Schaber <m....@3s-software.com>
> To: Ashod Nakashian <as...@yahoo.com>
> Cc: "dev@subversion.apache.org" <de...@subversion.apache.org>
> Sent: Sunday, March 25, 2012 11:28 PM
> Subject: AW: AW: Compressed Pristines (Custom Format?)
>
> Hi,
>
>> Von: Ashod Nakashian [mailto:ashodnakashian@yahoo.com]
>>
>> >The disadvantage clearly is that we need a few more bits when storing
>> that metadata in the SQLite database, instead of in our own file. But in
>> my eyes, this few bytes do not outweigh the overhead of inventing our own
>> metadata storage format, including correct synchronization, transaction
>> safety etc, which are already provided reliably by sqlite.
>>
>> The overhead in size isn't an issue (at least not a major one) rather
> the
>> overhead of *speed* is. At least that's my argument. I need to expand
> that
>> section with both approaches with pros/cons, but first let's agree on
> the
>> topic debated: to custom format, or to not.
>
> My guess is:
> - For reading, the sqlite approach is not measurable slower, as we have to read
> the wc.db pristine table nevertheless. Reading 3 additional columns is not more
> effort than reading some data from a different file.
>
> - For writing/updating, my guess is that the processing amount of
> (re)-compressing the pristine data, writing it back to disk etc. is at least one
> magnitude larger than the amount we need for both updating the row in the wc.db
> or updating the extra file, so for a first implementation, we can go the easier
> way, which is storing in wc.db in my eyes.
>
I've been convinced that wc.db is a good approach for the metadata and unless we have real numbers/facts to the contrary we shouldn't attempt to solve inexistent problems. The major topic of debate at this point remains the compressed file storage.
-Ash
>
> Best regards
>
> Markus Schaber
> --
> ___________________________
> We software Automation.
>
> 3S-Smart Software Solutions GmbH
> Markus Schaber | Developer
> Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax
> +49-831-54031-50
>
> Email: m.schaber@3s-software.com | Web: http://www.3s-software.com
> CoDeSys internet forum: http://forum.3s-software.com
> Download CoDeSys sample projects:
> http://www.3s-software.com/index.shtml?sample_projects
>
> Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade
> register: Kempten HRB 6186 | Tax ID No.: DE 167014915
>
AW: AW: Compressed Pristines (Custom Format?)
Posted by Markus Schaber <m....@3s-software.com>.
Hi,
> Von: Ashod Nakashian [mailto:ashodnakashian@yahoo.com]
>
> >The disadvantage clearly is that we need a few more bits when storing
> that metadata in the SQLite database, instead of in our own file. But in
> my eyes, this few bytes do not outweigh the overhead of inventing our own
> metadata storage format, including correct synchronization, transaction
> safety etc, which are already provided reliably by sqlite.
>
> The overhead in size isn't an issue (at least not a major one) rather the
> overhead of *speed* is. At least that's my argument. I need to expand that
> section with both approaches with pros/cons, but first let's agree on the
> topic debated: to custom format, or to not.
My guess is:
- For reading, the sqlite approach is not measurable slower, as we have to read the wc.db pristine table nevertheless. Reading 3 additional columns is not more effort than reading some data from a different file.
- For writing/updating, my guess is that the processing amount of (re)-compressing the pristine data, writing it back to disk etc. is at least one magnitude larger than the amount we need for both updating the row in the wc.db or updating the extra file, so for a first implementation, we can go the easier way, which is storing in wc.db in my eyes.
Best regards
Markus Schaber
--
___________________________
We software Automation.
3S-Smart Software Solutions GmbH
Markus Schaber | Developer
Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50
Email: m.schaber@3s-software.com | Web: http://www.3s-software.com
CoDeSys internet forum: http://forum.3s-software.com
Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects
Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915
Re: AW: Compressed Pristines (Custom Format?)
Posted by Greg Stein <gs...@gmail.com>.
On Fri, Mar 23, 2012 at 14:09, Ashod Nakashian <as...@yahoo.com> wrote:
>...
> The overhead in size isn't an issue (at least not a major one) rather the overhead of *speed* is. At least that's my argument. I need to expand that section with both approaches with pros/cons, but first let's agree on the topic debated: to custom format, or to not.
wc.db is always opened. In fact, it *must* be to look up any pristine
information. Opening that database is the slowest operation. From that
point, things are very fast.
For simplicity's sake, I would recommend an initial solution using
wc.db for the metadata. You could then write a test to see whether a
custom format would significantly outperform sqlite, and discussion a
change at that point.
IOW, do not "prematurely optimize". Go with the straightforward
sqlite-based solution and test/validate the speed in a future review.
Cheers,
-g
Re: AW: Compressed Pristines (Custom Format?)
Posted by Ashod Nakashian <as...@yahoo.com>.
>________________________________
> From: Markus Schaber <m....@3s-software.com>
>To: Ashod Nakashian <as...@yahoo.com>
>Cc: "dev@subversion.apache.org" <de...@subversion.apache.org>
>Sent: Friday, March 23, 2012 8:49 PM
>Subject: AW: Compressed Pristines (Custom Format?)
>
>Hi,
>
>> -----Ursprüngliche Nachricht-----
>
>> The gist of the above is that if we choose a better-than-gz compression
>> and combine the files both *before* and *after* compression, we'll have
>> much more significant results than what we have now just with gz on
>> individual files. This can be noticed using tar.bz2, for example, where
>> the result is not unlike what we can achieve with the custom file format
>> (although bz2 is probably too slow for our needs).
>
>Maybe xz (lzma2) is the algorithm to look at. It usually has a better ratio for cpu_usage/compression_factor, and decompression is nearly as fast as gz.
LZMA is a candidate. But my experience tells me it'll be too slow for our needs. But there are good candidates that I hope will give stunning results. The secret algorithm is PPMd (also available in the LZMA SDK) which isn't patented (AFAIK) and has some really fast implementations that have a compatible license to SVN. In time, we'll get to actually benchmarking them and picking a winner based on the results.
>
>> I also like the fact that the pristine files are opaque and don't
>> encourage the user to mess with them. Markus raised this point as
>> "debuggability". I don't see "debuggability" as a user requirement (it is
>> justifiably an SVN dev/maintainer requirement) and I don't find reason to
>> add it as one. On the contrary, there are many reasons to suspect the user
>> is doing something gravely wrong when they mess with the pristine files.
>
>So maybe a developer tool for (un)packing pristine archives should be created.
Yes, that's a very reasonable suggestion. It can use the same wc lib.
>
>> Another point raised by Markus is to store "common pristine" files and
>> reuse them to reduce network traffic.
>
>This point is seen to be independently of the compression of pristine store. Both a working-copy local and a common pristine store can profit from the compression.
I'd still keep it separate from the current topic/feature.
>
>> Sqlite may be used as Branko has suggested. I'm not opposed to this. It
>> has it's shortcomings (not exploiting inter-file similarities which point
>> #3 makes, for one) but it can be considered as a compromise between
>> individual gz files and the custom pack file. The basic idea would be to
>> store "small" files (after compression) in wc.db and have "link" to
>> compressed files on disk for "large" files.
>
>Maybe a distinct pristine.db bettern than to put them in wc.db, but I'm not sure about that.
>
>> My main concern is that
>> frequent updates to small files will leave the sqlite file with heavy
>> external fragmentation (holes within the file unused but consuming disk-
>> space).
>
>Usually, sqlite re-uses free space within the same database rather efficiently.
I don't have data on this, but I know that deletes don't repack the db file. Unless vacuum is used or other data is written, these unused pages (as they are called in the sqlite parlance) will remain wasted.
>
>> The solution is to "vacuum" wc.db, but that depends on its size,
>> will lock it when vacuuming and other factors, so we can't do it as
>> routine.
>
>"svn cleanup" would be a good opportunity.
I think we'll probably use that in either case, if not add a new one as well. It's too soon to tell.
>
>
>I just had another idea, we could store the metadata in the SQLite database:
>
>In the wc.db, in the pristine table, store 4 rows[1]: filename, offset, length, algorithm.
>
>"filename" denotes the container file name. Payload files are first concatenated, then compressed, then put into the container. Offset and length are byte-offsets in the decompressed bytestream. "Algorithm" denotes the compression algorithm, with one value reserved for uncompressed storage. If a container grows beyond a specific limit, a new file is created.
This is by and large the proposed approach. The only difference is that there is a contesting index file to store the metadata. The argument for it is that it's fast to read and load it and get a very fast data-structure in memory to manage the "containers" (which in the proposal are called packs). But wc.db is also considered as an alternative (proposed first by Greg).
>
>The main advantage of storing the metadata in SQLite is that we do not need to invent any new file format.
>
>Some other positive aspects (some of them are clearly also possible using your original proposal):
>
>- This allows to apply concatenation and compression orthogonally, on a container-by-container basis:
> - So we can handle short, non-compressable files just by concatenating them in an uncompressed container.
> - We can handle large, well-compressable files the "each file has its own container" way.
>
>- By reserving a special length value (like -1 or SQL NULL) for "look at the file on disk", we can quickly upgrade existing working copies without touching the pristine files at all.
> - This way, we could make the WC upgrade implicit again, as we only add three columns with well-defined default values (offset=0, length=-1, algorithm=uncompressed) to the table.
> - "svn cleanup" could grow an option to reorganize / optimize the pristine storage.
>
>- "debuggability" is somehow given:
> - If the SQLite db is still intact, the pristines can be decompressed and split into pieces just with tools like zcat, head and tail.
> - Even if the db is borked, most file formats have some heuristical "begin/end" markers (#include-lines, JFIF-Header, etc.) which allows forensics to find the ofsett and size using hexdump.
>
>- As most current decompressors for gz and lzma transparently support the decompression of streams which are "first compressed, then concatenated", we could even try to exploit transfer encodings (like transparent gz compression in http) which might already deliver us compressed files.
>
>The disadvantage clearly is that we need a few more bits when storing that metadata in the SQLite database, instead of in our own file. But in my eyes, this few bytes do not outweigh the overhead of inventing our own metadata storage format, including correct synchronization, transaction safety etc, which are already provided reliably by sqlite.
The overhead in size isn't an issue (at least not a major one) rather the overhead of *speed* is. At least that's my argument. I need to expand that section with both approaches with pros/cons, but first let's agree on the topic debated: to custom format, or to not.
Thanks,
Ash
>
>Best regards
>
>Markus Schaber
>
>[1] Plus the additional rows like ref_count, checksum etc., which are needed by svn, but are not of interest for this discussion.
>--
>___________________________
>We software Automation.
>
>3S-Smart Software Solutions GmbH
>Markus Schaber | Developer
>Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50
>
>Email: m.schaber@3s-software.com | Web: http://www.3s-software.com
>CoDeSys internet forum: http://forum.3s-software.com
>Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects
>
>Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915
>
>
>
AW: Compressed Pristines (Custom Format?)
Posted by Markus Schaber <m....@3s-software.com>.
Hi,
> -----Ursprüngliche Nachricht-----
> The gist of the above is that if we choose a better-than-gz compression
> and combine the files both *before* and *after* compression, we'll have
> much more significant results than what we have now just with gz on
> individual files. This can be noticed using tar.bz2, for example, where
> the result is not unlike what we can achieve with the custom file format
> (although bz2 is probably too slow for our needs).
Maybe xz (lzma2) is the algorithm to look at. It usually has a better ratio for cpu_usage/compression_factor, and decompression is nearly as fast as gz.
> I also like the fact that the pristine files are opaque and don't
> encourage the user to mess with them. Markus raised this point as
> "debuggability". I don't see "debuggability" as a user requirement (it is
> justifiably an SVN dev/maintainer requirement) and I don't find reason to
> add it as one. On the contrary, there are many reasons to suspect the user
> is doing something gravely wrong when they mess with the pristine files.
So maybe a developer tool for (un)packing pristine archives should be created.
> Another point raised by Markus is to store "common pristine" files and
> reuse them to reduce network traffic.
This point is seen to be independently of the compression of pristine store. Both a working-copy local and a common pristine store can profit from the compression.
> Sqlite may be used as Branko has suggested. I'm not opposed to this. It
> has it's shortcomings (not exploiting inter-file similarities which point
> #3 makes, for one) but it can be considered as a compromise between
> individual gz files and the custom pack file. The basic idea would be to
> store "small" files (after compression) in wc.db and have "link" to
> compressed files on disk for "large" files.
Maybe a distinct pristine.db bettern than to put them in wc.db, but I'm not sure about that.
> My main concern is that
> frequent updates to small files will leave the sqlite file with heavy
> external fragmentation (holes within the file unused but consuming disk-
> space).
Usually, sqlite re-uses free space within the same database rather efficiently.
> The solution is to "vacuum" wc.db, but that depends on its size,
> will lock it when vacuuming and other factors, so we can't do it as
> routine.
"svn cleanup" would be a good opportunity.
I just had another idea, we could store the metadata in the SQLite database:
In the wc.db, in the pristine table, store 4 rows[1]: filename, offset, length, algorithm.
"filename" denotes the container file name. Payload files are first concatenated, then compressed, then put into the container. Offset and length are byte-offsets in the decompressed bytestream. "Algorithm" denotes the compression algorithm, with one value reserved for uncompressed storage. If a container grows beyond a specific limit, a new file is created.
The main advantage of storing the metadata in SQLite is that we do not need to invent any new file format.
Some other positive aspects (some of them are clearly also possible using your original proposal):
- This allows to apply concatenation and compression orthogonally, on a container-by-container basis:
- So we can handle short, non-compressable files just by concatenating them in an uncompressed container.
- We can handle large, well-compressable files the "each file has its own container" way.
- By reserving a special length value (like -1 or SQL NULL) for "look at the file on disk", we can quickly upgrade existing working copies without touching the pristine files at all.
- This way, we could make the WC upgrade implicit again, as we only add three columns with well-defined default values (offset=0, length=-1, algorithm=uncompressed) to the table.
- "svn cleanup" could grow an option to reorganize / optimize the pristine storage.
- "debuggability" is somehow given:
- If the SQLite db is still intact, the pristines can be decompressed and split into pieces just with tools like zcat, head and tail.
- Even if the db is borked, most file formats have some heuristical "begin/end" markers (#include-lines, JFIF-Header, etc.) which allows forensics to find the ofsett and size using hexdump.
- As most current decompressors for gz and lzma transparently support the decompression of streams which are "first compressed, then concatenated", we could even try to exploit transfer encodings (like transparent gz compression in http) which might already deliver us compressed files.
The disadvantage clearly is that we need a few more bits when storing that metadata in the SQLite database, instead of in our own file. But in my eyes, this few bytes do not outweigh the overhead of inventing our own metadata storage format, including correct synchronization, transaction safety etc, which are already provided reliably by sqlite.
Best regards
Markus Schaber
[1] Plus the additional rows like ref_count, checksum etc., which are needed by svn, but are not of interest for this discussion.
--
___________________________
We software Automation.
3S-Smart Software Solutions GmbH
Markus Schaber | Developer
Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50
Email: m.schaber@3s-software.com | Web: http://www.3s-software.com
CoDeSys internet forum: http://forum.3s-software.com
Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects
Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915
Re: Compressed Pristines (Custom Format?)
Posted by Ashod Nakashian <as...@yahoo.com>.
----- Original Message -----
> From: Philip Martin <ph...@wandisco.com>
> To: Erik Huelsmann <eh...@gmail.com>
> Cc: Ashod Nakashian <as...@yahoo.com>; Daniel Shahaf <da...@elego.de>; "dev@subversion.apache.org" <de...@subversion.apache.org>; Ivan Zhakov <iv...@visualsvn.com>
> Sent: Thursday, March 22, 2012 4:00 PM
> Subject: Re: Compressed Pristines (Design Doc)
>
> Erik Huelsmann <eh...@gmail.com> writes:
>
>> As the others, I'm surprised we seem to be going with a custom file
> format.
>> You claim source files are generally small in size and hence only small
>> benefits can be had from compressing them, if at all, due to the fact that
>> they would be of sub-block size already.
>
> I was surprised too, so I looked at GCC where a trunk checkout has
> 75,000 files of various types:
>
[snip]
The current major concern seems to be the development of a new custom file-format that isn't warranted. This is a fair concern and one we should reach a consensus on before moving forward. I've tried to combine all issues raised on the topic so far in this (admittedly long) mail.
The design's fundamental assumption is that source files are typically smaller than a typical FS block (after compression). Eric and Philip have ran tests on SVN and GCC respectively with different results. I do not have hard-figures because it's near impossible to define "a typical project". However, let me point out the rationale behind this argument:
1. We don't care as much about file sizes before compression as we do *after* compression (with better compression, more files should fall into the sub-block size, which depends on the FS config, after compression).
2. Compressed file-size is highly dependent on the compression algorithm (we should use the best compression that meets our reqs).
3. Combining files *before* compression in many cases yield better compression, especially if multiple tags/branches are involved.[1]
4. Projects that have "small" files will suffer more by the wasted
sub-block space especially when multiple tags/branches are checked out
(typical for active maintainers).
5. Reducing the number of files on disk can improve overall disk performance (for very large projects).[2]
6. Flexibility, extensibility and opaqueness.
The gist of the above is that if we choose a better-than-gz compression and combine the files both *before* and *after* compression, we'll have much more significant results than what we have now just with gz on individual files. This can be noticed using tar.bz2, for example, where the result is not unlike what we can achieve with the custom file format (although bz2 is probably too slow for our needs).
Now, does this justify the cost of a new file-format? That's reasonable to argue. My take is that the proposed file-format is simple enough and the gains (especially on large projects with many branches/tags checked) should justify this overhead.
I also like the fact that the pristine files are opaque and don't encourage the user to mess with them. Markus raised this point as "debuggability". I don't see "debuggability" as a user requirement (it is justifiably an SVN dev/maintainer requirement) and I don't find reason to add it as one. On the contrary, there are many reasons to suspect the user is doing something gravely wrong when they mess with the pristine files.
Another point raised by Markus is to store "common pristine" files and reuse them to reduce network traffic. This is neither part of this feature, nor can we determine what's "common" and we shouldn't optimize repository protocol in the WC client. However, if the user checks-out multiple branches/tags in the same WC tree, they will get savings and if we combine the pristine files *before* compression, the savings should be significant as most files change little between branches (if nothing is changed, they'll have the same hash and only one copy will exist in the pristine store anyway). This latter advantage will be lost on per-file compression (point #3 above).
Sqlite may be used as Branko has suggested. I'm not opposed to this. It has it's shortcomings (not exploiting inter-file similarities which point #3 makes, for one) but it can be considered as a compromise between individual gz files and the custom pack file. The basic idea would be to store "small" files (after compression) in wc.db and have "link" to compressed files on disk for "large" files. My main concern is that frequent updates to small files will leave the sqlite file with heavy external fragmentation (holes within the file unused but consuming disk-space). The solution is to "vacuum" wc.db, but that depends on its size, will lock it when vacuuming and other factors, so we can't do it as routine. The custom pack file would take care of this by splitting the files such that avoiding external fragmentation would be feasible and routine (see the numbers in the doc for full defragmentation on typical pack store files). Of course we can use multiple
sqlite database files instead of the custom format and achieve the same goal, but my suspicion is that using sqlite for small files in the long run will probably give similar results as individual gz files (due to overhead, external fragmentation etc), so personally I feel it's probably not worth it.
A point regarding concurrency was raised (apologies for missing the name) regarding the custom format. Short answer: Yes! Files will be grouped and each group may be streamed to a compressor instance on separate threads and written to disk in parallel (thanks to splitting the pack files). The index file or wc.db may be a bottleneck, but the slow part is compressing, not updating entries.
So, again, the justification for the custom format are the points mentioned above. With the right compression algorithm, the custom format should give us a lot of flexibility and will result in disk savings that are significant to small and large WC's alike.
If I missed some point, please bring it up again, I don't mean to ignore them. Thanks for reading thus far.
[1] Compare total disk space of individual gz files and a tar.gz. Try the same with tar.bz2 which has a much larger window and yields significantly better compression. Boost 1.49 shows ~22% gain between tar.gz and tar.bz2 (http://sourceforge.net/projects/boost/files/boost/1.49.0/).
[2] My painful experience is with WebKit, 7 branches full-checkout on ntfs (2+ million total files on partition). Prior to svn 1.7 the number of files/folders was even worse.
Cheers,
Ash
Re: Compressed Pristines (Design Doc)
Posted by Philip Martin <ph...@wandisco.com>.
Erik Huelsmann <eh...@gmail.com> writes:
> As the others, I'm surprised we seem to be going with a custom file format.
> You claim source files are generally small in size and hence only small
> benefits can be had from compressing them, if at all, due to the fact that
> they would be of sub-block size already.
I was surprised too, so I looked at GCC where a trunk checkout has
75,000 files of various types:
$ find .svn/pristine -type f | wc -l
75192
Uncompressed:
$ du -hs .svn/pristine
635M .svn/pristine
$ find .svn/pristine -type f | xargs ls -ls | awk '{tot += $1} END {print tot}'
641536
Individually compressed is smaller by a factor of 2:
$ find .svn/pristine -type f | xargs gzip
$ du -hs .svn/pristine
367M .svn/pristine
$ find .svn/pristine -type f | xargs ls -ls | awk '{tot += $1} END {print tot}'
365624
As one single file is smaller by another factor of 3:
$ find .svn/pristine -type f | xargs cat >> one-big-file
$ du -hs one-big-file
122M one-big-file
$ ls -ls one-big-file | awk '{print $1}'
124516
When individually compressed most of the 75,000 files are less
than 4K:
$ find .svn/pristine -size -4096c | wc -l
71571
more than half are less than 1K:
$ find .svn/pristine -size -1024c | wc -l
53707
and nearly half are less than 0.5K:
$ find .svn/pristine -size -512c | wc -l
36521
In the uncompressed state:
62323 are less than 4K
36648 are less than 1K
21828 are less than 0.5K
Maybe GCC is not typical but, rather to my surprise, combining the
compressed files would be a significant improvement.
I also have an httpd trunk checkout (needs cleanup so bigger than
normal):
90M uncompressed
37M individually compressed
23M as one big file
That's more like your figures for Subversion where the major step is
individual compression.
--
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com
Re: Compressed Pristines (Design Doc)
Posted by Erik Huelsmann <eh...@gmail.com>.
Hi Ash,
Thanks for picking up the initiative to implement this feature.
On Thu, Mar 22, 2012 at 7:01 PM, Ivan Zhakov <iv...@visualsvn.com> wrote:
> On Thu, Mar 22, 2012 at 18:30, Daniel Shahaf <da...@elego.de> wrote:
> > OK, I've had a cruise through now.
> >
> > First of all I have to say it's an order of magnitude larger than what
> > I'd imagined it would be. That makes the "move it elsewhere" idea I'd
> > had less practical than I'd predicted. I'm also not intending to take
> > you up on your offer to proxy me to the doc, though thanks for making it.
> >
> > Design-wise I'm a bit surprised that the choice ended up being rolling
> > a custom file format.
> >
> > Thanks for your work.
> >
> +1. I believe we should implement compressed pristine in simple way:
> just compress pristine files itself, without inventing some new
> format.
As the others, I'm surprised we seem to be going with a custom file format.
You claim source files are generally small in size and hence only small
benefits can be had from compressing them, if at all, due to the fact that
they would be of sub-block size already.
To substantiate that claim, I took the pristines directory from my
Subversion working copy and did some experimenting. See results below:
$ ls -ls uncompressed-pristines/*/*.svn-base | awk '{ tot += $1; } END {
print "total size " tot; }'
total size: 188724
$ cp -Rp uncompressed-pristines/ compressed-pristines
$ gzip compressed-pristines/*/*.svn-base
$ ls -ls compressed-pristines/*/*.svn-base.gz | awk '{ tot += $1; } END {
print "total size " tot; }'
total size: 52320
$ cat compressed-pristines/*/*.svn-base.gz > combined-compressed-file
$ ls -ls combined-compressed-file
41812 ....
So, if I look at the Subversion pristines in my working copy, the reduction
in allocated blocks goes from 100% to 27%. To be honest, I doubt the
complexity we'll be importing just to reduce the allocated number of blocks
from 27% to 22% is really worth it: the savings are already tremendous.
Won't the creation of a custom storage format just serve to destabilize our
working copy?
Do you have data which triggered you to design this custom format?
Bye,
Erik.
Re: Compressed Pristines (Design Doc)
Posted by Ivan Zhakov <iv...@visualsvn.com>.
On Thu, Mar 22, 2012 at 18:30, Daniel Shahaf <da...@elego.de> wrote:
> OK, I've had a cruise through now.
>
> First of all I have to say it's an order of magnitude larger than what
> I'd imagined it would be. That makes the "move it elsewhere" idea I'd
> had less practical than I'd predicted. I'm also not intending to take
> you up on your offer to proxy me to the doc, though thanks for making it.
>
> Design-wise I'm a bit surprised that the choice ended up being rolling
> a custom file format.
>
> Thanks for your work.
>
+1. I believe we should implement compressed pristine in simple way:
just compress pristine files itself, without inventing some new
format.
--
Ivan Zhakov
Re: Compressed Pristines (Design Doc)
Posted by Branko Čibej <br...@apache.org>.
On 22.03.2012 16:23, Mark Phippard wrote:
> On Thu, Mar 22, 2012 at 11:18 AM, Ashod Nakashian
> <as...@yahoo.com> wrote:
>>> Design-wise I'm a bit surprised that the choice ended up being rolling
>>> a custom file format.
>> Personally I know not of any library that can deliver the requirements that we need (outlined in the doc). Again, if the requirements
>> are in question, let's simplify them. If there is such a library, suggesting it will save us a lot of time and effort. Otherwise, using a
>> Tar-like container will just not cut it. On the other hand, the proposed custom format is rather simple and its code shouldn't be
>> complex. In fact, I suspect Tar is more complex (considering it must store more information than we do).
> I am not sure what Daniel meant, but I had always just assumed we
> would simply compress the files in the existing pristines. I think
> your document does a nice job explaining why that is not good enough.
> In that sense, I would also say that I was surprised by the choice of
> a custom file format, but that does not mean I would question it. I
> think your document does a nice job in revealing some of the subtle
> complexities of this feature. That gives me more hope on progress
> towards a solution.
I'd like to point out that there /is/ a library that handles storage,
lookup, access and deletion of many small files in a single large one
quite efficiently. Well tested, too, widely used, and configurable with
regard to space reclamation. Moreover, we're already using that library.
It's called SQLite.
-- Brane
AW: Compressed Pristines (Design Doc)
Posted by Markus Schaber <m....@3s-software.com>.
Hi,
I just want to shed light on three arguments against a new custom archive format.
Compressing the files using a standard format (like gz or xz) file-by-file has the advantage of better debuggability. Developers can easily (de)compress or otherwise those files using their standard utilities when trying to debug problems. Using a custom format always makes that process more difficult.
In addition, increasingly more file systems support features like block_suballocation, tail packing or tail merging[1]. This drastically reduces the space loss due to files being smaller than the block size.
And the third argument is the simplicity of implementation. Just checking .svn/pristines/ab/abcd.gz in addition to .svn/pristines/ab/abcd when searching for a pristine file is much easier to implement.
I'm not opposed in general to storing pristines in an archive, but the disadvantages should be weighted in when making the decision.
A different, somehow related idea is a common pristine store somewhere in the users directory, shared by several working copies. Especially when checking out several working copies of the same project (or similar branches), this could save a lot of network traffic.
Best regards
Markus Schaber
[1]: http://msdn.microsoft.com/en-us/library/windows/desktop/ee681827%28v=vs.85%29.aspx claims tail packing support for NTFS. http://en.wikipedia.org/wiki/Block_suballocation claims support for Btrfs, ReiserFS, Reiser4, FreeBSD UFS2. And AFAIR, XFS has a similar feature.
--
___________________________
We software Automation.
3S-Smart Software Solutions GmbH
Markus Schaber | Developer
Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 | Fax +49-831-54031-50
Email: m.schaber@3s-software.com | Web: http://www.3s-software.com
CoDeSys internet forum: http://forum.3s-software.com
Download CoDeSys sample projects: http://www.3s-software.com/index.shtml?sample_projects
Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915
-----Ursprüngliche Nachricht-----
Von: Mark Phippard [mailto:markphip@gmail.com]
Gesendet: Donnerstag, 22. März 2012 16:23
An: Ashod Nakashian
Cc: Daniel Shahaf; dev@subversion.apache.org
Betreff: Re: Compressed Pristines (Design Doc)
On Thu, Mar 22, 2012 at 11:18 AM, Ashod Nakashian <as...@yahoo.com> wrote:
>>Design-wise I'm a bit surprised that the choice ended up being rolling
>>a custom file format.
>
> Personally I know not of any library that can deliver the requirements
> that we need (outlined in the doc). Again, if the requirements are in
> question, let's simplify them. If there is such a library, suggesting
> it will save us a lot of time and effort. Otherwise, using a Tar-like container will just not cut it. On the other hand, the proposed custom format is rather simple and its code shouldn't be complex. In fact, I suspect Tar is more complex (considering it must store more information than we do).
I am not sure what Daniel meant, but I had always just assumed we would simply compress the files in the existing pristines. I think your document does a nice job explaining why that is not good enough.
In that sense, I would also say that I was surprised by the choice of a custom file format, but that does not mean I would question it. I think your document does a nice job in revealing some of the subtle complexities of this feature. That gives me more hope on progress towards a solution.
--
Thanks
Mark Phippard
http://markphip.blogspot.com/
Re: Compressed Pristines (Design Doc)
Posted by Mark Phippard <ma...@gmail.com>.
On Thu, Mar 22, 2012 at 11:18 AM, Ashod Nakashian
<as...@yahoo.com> wrote:
>>Design-wise I'm a bit surprised that the choice ended up being rolling
>>a custom file format.
>
> Personally I know not of any library that can deliver the requirements that we need (outlined in the doc). Again, if the requirements
> are in question, let's simplify them. If there is such a library, suggesting it will save us a lot of time and effort. Otherwise, using a
> Tar-like container will just not cut it. On the other hand, the proposed custom format is rather simple and its code shouldn't be
> complex. In fact, I suspect Tar is more complex (considering it must store more information than we do).
I am not sure what Daniel meant, but I had always just assumed we
would simply compress the files in the existing pristines. I think
your document does a nice job explaining why that is not good enough.
In that sense, I would also say that I was surprised by the choice of
a custom file format, but that does not mean I would question it. I
think your document does a nice job in revealing some of the subtle
complexities of this feature. That gives me more hope on progress
towards a solution.
--
Thanks
Mark Phippard
http://markphip.blogspot.com/
Re: Compressed Pristines (Design Doc)
Posted by Ashod Nakashian <as...@yahoo.com>.
>________________________________
> From: Daniel Shahaf <da...@elego.de>
>To: Ashod Nakashian <as...@yahoo.com>
>Cc: "dev@subversion.apache.org" <de...@subversion.apache.org>
>Sent: Thursday, March 22, 2012 7:30 AM
>Subject: Re: Compressed Pristines (Design Doc)
>
>OK, I've had a cruise through now.
>
>First of all I have to say it's an order of magnitude larger than what
>I'd imagined it would be. That makes the "move it elsewhere" idea I'd
>had less practical than I'd predicted. I'm also not intending to take
>you up on your offer to proxy me to the doc, though thanks for making it.
If there are any ideas for simplifying things, I think it's well worth the effort. I for one am not for unecessary complexity. This is why I took the time to outline a set of requirements. If the requirements are excessive, let's simply them first. And based on the requirements alone can one justify the design.
>
>Design-wise I'm a bit surprised that the choice ended up being rolling
>a custom file format.
Personally I know not of any library that can deliver the requirements that we need (outlined in the doc). Again, if the requirements are in question, let's simplify them. If there is such a library, suggesting it will save us a lot of time and effort. Otherwise, using a Tar-like container will just not cut it. On the other hand, the proposed custom format is rather simple and its code shouldn't be complex. In fact, I suspect Tar is more complex (considering it must store more information than we do).
-Ash
>
>Thanks for your work.
>
>Cheers,
>
>Daniel
>
>Ashod Nakashian wrote on Thu, Mar 22, 2012 at 00:15:21 -0700:
>> >________________________________
>> > From: Daniel Shahaf <da...@elego.de>
>> >To: Greg Stein <gs...@gmail.com>
>> >Cc: Ashod Nakashian <as...@yahoo.com>; dev@subversion.apache.org
>> >Sent: Wednesday, March 21, 2012 2:08 PM
>> >Subject: Re: Compressed Pristines (Design Doc)
>> >
>> >Greg Stein wrote on Wed, Mar 21, 2012 at 16:51:47 -0400:
>> >> On Wed, Mar 21, 2012 at 16:11, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
>> >> > Ashod Nakashian wrote on Wed, Mar 21, 2012 at 12:19:02 -0700:
>> >> >> All,
>> >> >>
>> >> >> I'm happy to share[1] with you the design document for the Compressed Pristines feature. The document is public and anyone can comment on any part
>> >> >
>> >> > I can't. Can you please move the document to our wiki, or dump it in an
>> >> > email to dev@, or on a pastebin, somewhere everyone canread it.
>> >>
>> >> I just opened it in an incognito window in Chrome. You should be able
>> >> to access the thing.
>> >>
>> >
>> >Tried, I get as far as the doc title. I don't see its contents.
>>
>>
>> Daniel (and all who can't access the doc),
>>
>> I'm attaching the PDF and ODT versions with updates based on Greg's comments. I'd like to hear all opinions and comments. Google docs is a fairly ideal environment for live commenting and editing, so it's too bad that you can't access the file.
>>
>> Please let me know if you have any notes/comments on the design. If you'd like to use the ODT file for comments and edits, please mark your input clearly and I'll update the Google doc with your notes.
>>
>> Thanks,
>> Ash
>
>
>
>
>
>
Re: Compressed Pristines (Design Doc)
Posted by Daniel Shahaf <da...@elego.de>.
OK, I've had a cruise through now.
First of all I have to say it's an order of magnitude larger than what
I'd imagined it would be. That makes the "move it elsewhere" idea I'd
had less practical than I'd predicted. I'm also not intending to take
you up on your offer to proxy me to the doc, though thanks for making it.
Design-wise I'm a bit surprised that the choice ended up being rolling
a custom file format.
Thanks for your work.
Cheers,
Daniel
Ashod Nakashian wrote on Thu, Mar 22, 2012 at 00:15:21 -0700:
> >________________________________
> > From: Daniel Shahaf <da...@elego.de>
> >To: Greg Stein <gs...@gmail.com>
> >Cc: Ashod Nakashian <as...@yahoo.com>; dev@subversion.apache.org
> >Sent: Wednesday, March 21, 2012 2:08 PM
> >Subject: Re: Compressed Pristines (Design Doc)
> >
> >Greg Stein wrote on Wed, Mar 21, 2012 at 16:51:47 -0400:
> >> On Wed, Mar 21, 2012 at 16:11, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> >> > Ashod Nakashian wrote on Wed, Mar 21, 2012 at 12:19:02 -0700:
> >> >> All,
> >> >>
> >> >> I'm happy to share[1] with you the design document for the Compressed Pristines feature. The document is public and anyone can comment on any part
> >> >
> >> > I can't. Can you please move the document to our wiki, or dump it in an
> >> > email to dev@, or on a pastebin, somewhere everyone canread it.
> >>
> >> I just opened it in an incognito window in Chrome. You should be able
> >> to access the thing.
> >>
> >
> >Tried, I get as far as the doc title. I don't see its contents.
>
>
> Daniel (and all who can't access the doc),
>
> I'm attaching the PDF and ODT versions with updates based on Greg's comments. I'd like to hear all opinions and comments. Google docs is a fairly ideal environment for live commenting and editing, so it's too bad that you can't access the file.
>
> Please let me know if you have any notes/comments on the design. If you'd like to use the ODT file for comments and edits, please mark your input clearly and I'll update the Google doc with your notes.
>
> Thanks,
> Ash
Re: Compressed Pristines (Design Doc)
Posted by Branko Čibej <br...@apache.org>.
On 21.03.2012 22:08, Daniel Shahaf wrote:
> Greg Stein wrote on Wed, Mar 21, 2012 at 16:51:47 -0400:
>> On Wed, Mar 21, 2012 at 16:11, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
>>> Ashod Nakashian wrote on Wed, Mar 21, 2012 at 12:19:02 -0700:
>>>> All,
>>>>
>>>> I'm happy to share[1] with you the design document for the Compressed Pristines feature. The document is public and anyone can comment on any part
>>> I can't. Can you please move the document to our wiki, or dump it in an
>>> email to dev@, or on a pastebin, somewhere everyone canread it.
>> I just opened it in an incognito window in Chrome. You should be able
>> to access the thing.
>>
> Tried, I get as far as the doc title. I don't see its contents.
Enable javascript in your browser. Sorry.
-- Brane
Re: Compressed Pristines (Design Doc)
Posted by Daniel Shahaf <da...@elego.de>.
Thanks Ash! I'm in the middle of something right now, but I'll read it
once I'm done.
Ashod Nakashian wrote on Thu, Mar 22, 2012 at 00:15:21 -0700:
> >________________________________
> > From: Daniel Shahaf <da...@elego.de>
> >To: Greg Stein <gs...@gmail.com>
> >Cc: Ashod Nakashian <as...@yahoo.com>; dev@subversion.apache.org
> >Sent: Wednesday, March 21, 2012 2:08 PM
> >Subject: Re: Compressed Pristines (Design Doc)
> >
> >Greg Stein wrote on Wed, Mar 21, 2012 at 16:51:47 -0400:
> >> On Wed, Mar 21, 2012 at 16:11, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> >> > Ashod Nakashian wrote on Wed, Mar 21, 2012 at 12:19:02 -0700:
> >> >> All,
> >> >>
> >> >> I'm happy to share[1] with you the design document for the Compressed Pristines feature. The document is public and anyone can comment on any part
> >> >
> >> > I can't. Can you please move the document to our wiki, or dump it in an
> >> > email to dev@, or on a pastebin, somewhere everyone canread it.
> >>
> >> I just opened it in an incognito window in Chrome. You should be able
> >> to access the thing.
> >>
> >
> >Tried, I get as far as the doc title. I don't see its contents.
>
>
> Daniel (and all who can't access the doc),
>
> I'm attaching the PDF and ODT versions with updates based on Greg's comments. I'd like to hear all opinions and comments. Google docs is a fairly ideal environment for live commenting and editing, so it's too bad that you can't access the file.
>
> Please let me know if you have any notes/comments on the design. If you'd like to use the ODT file for comments and edits, please mark your input clearly and I'll update the Google doc with your notes.
>
> Thanks,
> Ash
Re: Compressed Pristines (Design Doc)
Posted by Ashod Nakashian <as...@yahoo.com>.
>________________________________
> From: Greg Stein <gs...@gmail.com>
>To: Thomas Åkesson <th...@akesson.cc>
>Cc: Ashod Nakashian <as...@yahoo.com>; Subversion Development <de...@subversion.apache.org>
>Sent: Monday, March 26, 2012 7:42 AM
>Subject: Re: Compressed Pristines (Design Doc)
>
>
>Yeah... optional pristines is orthogonal, and should be considered seperately. It is also a very difficult problem because users of the various APIs expect the pristine to always be present.
>Cheers,
>-g
>On Mar 25, 2012 7:41 PM, "Thomas Åkesson" <th...@akesson.cc> wrote:
>
>Hi Ash,
>>
>>I noticed that "Remove pristine store or render optional" is considered a Non-Goal. If changes are made to wc-db in order to manage compressed pristines, it might make sense to ensure that the design can also handle optional pristines in the future.
I do not mind in the least to make provisions for such a future possibility. But like Greg said, it's really orthogonal to the feature at hand and does suffer quite a bit of complexity itself to be included within the current scope, which is already a mouthful.
-Ash
>>
>>The typical Subversion use case (code/text) will obviously benefit from compressed pristines. However, when storing binary files (e.g. graphics), which tend to be larger and less frequently modified files, optional pristines will likely be more beneficial.
>>
>>Thanks,
>>Thomas Å.
>>
>>
>>On 22 mar 2012, at 08:15, Ashod Nakashian wrote:
>>
>>>> ________________________________
>>>> From: Daniel Shahaf <da...@elego.de>
>>>> To: Greg Stein <gs...@gmail.com>
>>>> Cc: Ashod Nakashian <as...@yahoo.com>; dev@subversion.apache.org
>>>> Sent: Wednesday, March 21, 2012 2:08 PM
>>>> Subject: Re: Compressed Pristines (Design Doc)
>>>>
>>>> Greg Stein wrote on Wed, Mar 21, 2012 at 16:51:47 -0400:
>>>>> On Wed, Mar 21, 2012 at 16:11, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
>>>>>> Ashod Nakashian wrote on Wed, Mar 21, 2012 at 12:19:02 -0700:
>>>>>>> All,
>>>>>>>
>>>>>>> I'm happy to share[1] with you the design document for the Compressed Pristines feature. The document is public and anyone can comment on any part
>>>>>>
>>>>>> I can't. Can you please move the document to our wiki, or dump it in an
>>>>>> email to dev@, or on a pastebin, somewhere everyone canread it.
>>>>>
>>>>> I just opened it in an incognito window in Chrome. You should be able
>>>>> to access the thing.
>>>>>
>>>>
>>>> Tried, I get as far as the doc title. I don't see its contents.
>>>
>>>
>>> Daniel (and all who can't access the doc),
>>>
>>> I'm attaching the PDF and ODT versions with updates based on Greg's comments. I'd like to hear all opinions and comments. Google docs is a fairly ideal environment for live commenting and editing, so it's too bad that you can't access the file.
>>>
>>> Please let me know if you have any notes/comments on the design. If you'd like to use the ODT file for comments and edits, please mark your input clearly and I'll update the Google doc with your notes.
>>>
>>> Thanks,
>>> Ash<SubversionCompressedPristinesDesign.pdf><SubversionCompressedPristinesDesign.odt>
>>
>>
>
>
Re: Compressed Pristines (Design Doc)
Posted by Greg Stein <gs...@gmail.com>.
Yeah... optional pristines is orthogonal, and should be considered
seperately. It is also a very difficult problem because users of the
various APIs expect the pristine to always be present.
Cheers,
-g
On Mar 25, 2012 7:41 PM, "Thomas Åkesson" <th...@akesson.cc> wrote:
> Hi Ash,
>
> I noticed that "Remove pristine store or render optional" is considered a
> Non-Goal. If changes are made to wc-db in order to manage compressed
> pristines, it might make sense to ensure that the design can also handle
> optional pristines in the future.
>
> The typical Subversion use case (code/text) will obviously benefit from
> compressed pristines. However, when storing binary files (e.g. graphics),
> which tend to be larger and less frequently modified files, optional
> pristines will likely be more beneficial.
>
> Thanks,
> Thomas Å.
>
>
> On 22 mar 2012, at 08:15, Ashod Nakashian wrote:
>
> >> ________________________________
> >> From: Daniel Shahaf <da...@elego.de>
> >> To: Greg Stein <gs...@gmail.com>
> >> Cc: Ashod Nakashian <as...@yahoo.com>;
> dev@subversion.apache.org
> >> Sent: Wednesday, March 21, 2012 2:08 PM
> >> Subject: Re: Compressed Pristines (Design Doc)
> >>
> >> Greg Stein wrote on Wed, Mar 21, 2012 at 16:51:47 -0400:
> >>> On Wed, Mar 21, 2012 at 16:11, Daniel Shahaf <d....@daniel.shahaf.name>
> wrote:
> >>>> Ashod Nakashian wrote on Wed, Mar 21, 2012 at 12:19:02 -0700:
> >>>>> All,
> >>>>>
> >>>>> I'm happy to share[1] with you the design document for the
> Compressed Pristines feature. The document is public and anyone can comment
> on any part
> >>>>
> >>>> I can't. Can you please move the document to our wiki, or dump it in
> an
> >>>> email to dev@, or on a pastebin, somewhere everyone canread it.
> >>>
> >>> I just opened it in an incognito window in Chrome. You should be able
> >>> to access the thing.
> >>>
> >>
> >> Tried, I get as far as the doc title. I don't see its contents.
> >
> >
> > Daniel (and all who can't access the doc),
> >
> > I'm attaching the PDF and ODT versions with updates based on Greg's
> comments. I'd like to hear all opinions and comments. Google docs is a
> fairly ideal environment for live commenting and editing, so it's too bad
> that you can't access the file.
> >
> > Please let me know if you have any notes/comments on the design. If
> you'd like to use the ODT file for comments and edits, please mark your
> input clearly and I'll update the Google doc with your notes.
> >
> > Thanks,
> >
> Ash<SubversionCompressedPristinesDesign.pdf><SubversionCompressedPristinesDesign.odt>
>
>
Re: Compressed Pristines (Design Doc)
Posted by Thomas Åkesson <th...@akesson.cc>.
Hi Ash,
I noticed that "Remove pristine store or render optional" is considered a Non-Goal. If changes are made to wc-db in order to manage compressed pristines, it might make sense to ensure that the design can also handle optional pristines in the future.
The typical Subversion use case (code/text) will obviously benefit from compressed pristines. However, when storing binary files (e.g. graphics), which tend to be larger and less frequently modified files, optional pristines will likely be more beneficial.
Thanks,
Thomas Å.
On 22 mar 2012, at 08:15, Ashod Nakashian wrote:
>> ________________________________
>> From: Daniel Shahaf <da...@elego.de>
>> To: Greg Stein <gs...@gmail.com>
>> Cc: Ashod Nakashian <as...@yahoo.com>; dev@subversion.apache.org
>> Sent: Wednesday, March 21, 2012 2:08 PM
>> Subject: Re: Compressed Pristines (Design Doc)
>>
>> Greg Stein wrote on Wed, Mar 21, 2012 at 16:51:47 -0400:
>>> On Wed, Mar 21, 2012 at 16:11, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
>>>> Ashod Nakashian wrote on Wed, Mar 21, 2012 at 12:19:02 -0700:
>>>>> All,
>>>>>
>>>>> I'm happy to share[1] with you the design document for the Compressed Pristines feature. The document is public and anyone can comment on any part
>>>>
>>>> I can't. Can you please move the document to our wiki, or dump it in an
>>>> email to dev@, or on a pastebin, somewhere everyone canread it.
>>>
>>> I just opened it in an incognito window in Chrome. You should be able
>>> to access the thing.
>>>
>>
>> Tried, I get as far as the doc title. I don't see its contents.
>
>
> Daniel (and all who can't access the doc),
>
> I'm attaching the PDF and ODT versions with updates based on Greg's comments. I'd like to hear all opinions and comments. Google docs is a fairly ideal environment for live commenting and editing, so it's too bad that you can't access the file.
>
> Please let me know if you have any notes/comments on the design. If you'd like to use the ODT file for comments and edits, please mark your input clearly and I'll update the Google doc with your notes.
>
> Thanks,
> Ash<SubversionCompressedPristinesDesign.pdf><SubversionCompressedPristinesDesign.odt>
Re: Compressed Pristines (Design Doc)
Posted by Ashod Nakashian <as...@yahoo.com>.
>________________________________
> From: Daniel Shahaf <da...@elego.de>
>To: Greg Stein <gs...@gmail.com>
>Cc: Ashod Nakashian <as...@yahoo.com>; dev@subversion.apache.org
>Sent: Wednesday, March 21, 2012 2:08 PM
>Subject: Re: Compressed Pristines (Design Doc)
>
>Greg Stein wrote on Wed, Mar 21, 2012 at 16:51:47 -0400:
>> On Wed, Mar 21, 2012 at 16:11, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
>> > Ashod Nakashian wrote on Wed, Mar 21, 2012 at 12:19:02 -0700:
>> >> All,
>> >>
>> >> I'm happy to share[1] with you the design document for the Compressed Pristines feature. The document is public and anyone can comment on any part
>> >
>> > I can't. Can you please move the document to our wiki, or dump it in an
>> > email to dev@, or on a pastebin, somewhere everyone canread it.
>>
>> I just opened it in an incognito window in Chrome. You should be able
>> to access the thing.
>>
>
>Tried, I get as far as the doc title. I don't see its contents.
Daniel (and all who can't access the doc),
I'm attaching the PDF and ODT versions with updates based on Greg's comments. I'd like to hear all opinions and comments. Google docs is a fairly ideal environment for live commenting and editing, so it's too bad that you can't access the file.
Please let me know if you have any notes/comments on the design. If you'd like to use the ODT file for comments and edits, please mark your input clearly and I'll update the Google doc with your notes.
Thanks,
Ash
Re: Compressed Pristines (Design Doc)
Posted by Daniel Shahaf <da...@elego.de>.
Greg Stein wrote on Wed, Mar 21, 2012 at 16:51:47 -0400:
> On Wed, Mar 21, 2012 at 16:11, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> > Ashod Nakashian wrote on Wed, Mar 21, 2012 at 12:19:02 -0700:
> >> All,
> >>
> >> I'm happy to share[1] with you the design document for the Compressed Pristines feature. The document is public and anyone can comment on any part
> >
> > I can't. Can you please move the document to our wiki, or dump it in an
> > email to dev@, or on a pastebin, somewhere everyone canread it.
>
> I just opened it in an incognito window in Chrome. You should be able
> to access the thing.
>
Tried, I get as far as the doc title. I don't see its contents.
Re: Compressed Pristines (Design Doc)
Posted by Greg Stein <gs...@gmail.com>.
On Wed, Mar 21, 2012 at 16:11, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> Ashod Nakashian wrote on Wed, Mar 21, 2012 at 12:19:02 -0700:
>> All,
>>
>> I'm happy to share[1] with you the design document for the Compressed Pristines feature. The document is public and anyone can comment on any part
>
> I can't. Can you please move the document to our wiki, or dump it in an
> email to dev@, or on a pastebin, somewhere everyone canread it.
I just opened it in an incognito window in Chrome. You should be able
to access the thing.
Cheers,
-g
Re: Compressed Pristines (Design Doc)
Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Ashod Nakashian wrote on Wed, Mar 21, 2012 at 12:19:02 -0700:
> All,
>
> I'm happy to share[1] with you the design document for the Compressed Pristines feature. The document is public and anyone can comment on any part
I can't. Can you please move the document to our wiki, or dump it in an
email to dev@, or on a pastebin, somewhere everyone canread it.
Thanks
Re: Compressed Pristines (Simulation)
Posted by Ashod Nakashian <as...@yahoo.com>.
----- Original Message -----
> From: Johan Corveleyn <jc...@gmail.com>
> To: Ashod Nakashian <as...@yahoo.com>
> Cc: "dev@subversion.apache.org" <de...@subversion.apache.org>
> Sent: Monday, March 26, 2012 3:10 AM
> Subject: Re: Compressed Pristines (Simulation)
>
> On Sun, Mar 25, 2012 at 7:17 PM, Ashod Nakashian
> <as...@yahoo.com> wrote:
> [snip]
>>> From: Hyrum K Wright <hy...@wandisco.com>
> [snip]
>>> In some respects, it looks like you're solving *two* problems:
>>> compression and the internal fragmentation due to large FS block
>>> sizes. How orthogonal are the problems? Could they be solved
>>> independently of each other in some way? I know that compression
>>> exposes the internal fragmentation issue, but used alone it certainly
>>> doesn't make things *worse* does it?
>>
>> Compression exposes internal fragmentation and, yes, it makes it *worse*
> (see hard numbers below).
>> Therefore, compression and internal fragmentation are orthogonal only if we
> care about absolute savings. (In other words, compressed files cause more
> internal fragmentation, but overall footprint is still reduced, however not as
> efficiently as ultimately possible.)
>
> By "doesn't make things worse", maybe Hyrum meant that compression
> doesn't magically cause more blocks to be used because of
> fragmentation. I mean, sure there is more fragmentation relative to
> the amount of data, but that's just because the amount of data
> decreased, right? Anyway, it depends on how you look at it, not too
> important.
Yes. I should've made myself clearer. I meant that's the case BUT the opportunity for further reduction in disk space is also increased (which is a prime interest in this feature).
>
> [snip]
>
>>
>> Since the debated techniques (individual gz files vs packing+gz) for
> implementing Compressed Pristines are within reach with existing tools, and
> indeed some tests were done to yield hard figures (see older messages in this
> thread), it's reasonable to run simulations that can show with hard numbers
> the extent to which the speculations and estimations done (mostly by yours
> truly) regarding the advantages of a custom pack file are justifiable.
>>
>
> I didn't read the design doc yet (it's a bit too big for me at the
> moment, I'm just following the dev-threads), so sorry if I'm saying
> nonsense.
You should read it :-) As you'll see, some of your points are what's suggested.
>
> Wouldn't gz+packing be another interesting compromise? It wouldn't
> exploit inter-file similarities, but it would yield compression and
> reduced fragmentation. Can you test that as well? Maybe that gets us
> "80% gain for 20% of the effort" ...
Yes. And that's a "stage" in the implementation of this feature. We don't have to go for the optimum implementation right-away, just packing will help. What's argued is whether or not a custom file format (the pack file) is necessary or not.
>
> I'm certainly not an expert, but intuitively the packing+gz approach
> seems difficult to me, if only because you need to uncompress a full
> pack file to be able to read a single pristine (since offsets are
> relative to the uncompressed stream). So the advantage of exploiting
> inter-file similarities better be worth it.
To avoid that, we'll compress individual blocks (each containing at least 1 file, and potentially many to exploit inter-file similarities).
>
> When going for gz+packing, there is no need to uncompress an entire
> pack file just to start reading a single pristine. You can just keep
> offsets (in wc.db or whatever) to where the individual compressed
> pristines exist inside the pack file.
Indeed, it's what's proposed. Although there are two suggestions: a custom index file that dumps structures that can be reloaded fast or wc.db.
>
> Why not simply compress the "shards" we already have in the pristine
> store (sharded by the first two characters of the pristine checksum)?
> Or do we run the risk that such compressed shards are going to become
> too large (e.g. larger than 2 GB), and we want to avoid such a thing?
May be too large (as you suspected), what unites the files within a shard is their hash and not contents, requires the same infrastructure to locate a file, same overhead of managing inserts/deletes... so doesn't have any advantage and all the same problems.
The proposal is to have a custom file format that is simple and supports all our requirements out of the box and is file-name and file-type aware and can exploit all that if necessary.
-Ash
>
> --
> Johan
>
Re: Compressed Pristines (Simulation)
Posted by Johan Corveleyn <jc...@gmail.com>.
On Sun, Mar 25, 2012 at 7:17 PM, Ashod Nakashian
<as...@yahoo.com> wrote:
[snip]
>> From: Hyrum K Wright <hy...@wandisco.com>
[snip]
>>In some respects, it looks like you're solving *two* problems:
>>compression and the internal fragmentation due to large FS block
>>sizes. How orthogonal are the problems? Could they be solved
>>independently of each other in some way? I know that compression
>>exposes the internal fragmentation issue, but used alone it certainly
>>doesn't make things *worse* does it?
>
> Compression exposes internal fragmentation and, yes, it makes it *worse* (see hard numbers below).
> Therefore, compression and internal fragmentation are orthogonal only if we care about absolute savings. (In other words, compressed files cause more internal fragmentation, but overall footprint is still reduced, however not as efficiently as ultimately possible.)
By "doesn't make things worse", maybe Hyrum meant that compression
doesn't magically cause more blocks to be used because of
fragmentation. I mean, sure there is more fragmentation relative to
the amount of data, but that's just because the amount of data
decreased, right? Anyway, it depends on how you look at it, not too
important.
[snip]
>
> Since the debated techniques (individual gz files vs packing+gz) for implementing Compressed Pristines are within reach with existing tools, and indeed some tests were done to yield hard figures (see older messages in this thread), it's reasonable to run simulations that can show with hard numbers the extent to which the speculations and estimations done (mostly by yours truly) regarding the advantages of a custom pack file are justifiable.
>
I didn't read the design doc yet (it's a bit too big for me at the
moment, I'm just following the dev-threads), so sorry if I'm saying
nonsense.
Wouldn't gz+packing be another interesting compromise? It wouldn't
exploit inter-file similarities, but it would yield compression and
reduced fragmentation. Can you test that as well? Maybe that gets us
"80% gain for 20% of the effort" ...
I'm certainly not an expert, but intuitively the packing+gz approach
seems difficult to me, if only because you need to uncompress a full
pack file to be able to read a single pristine (since offsets are
relative to the uncompressed stream). So the advantage of exploiting
inter-file similarities better be worth it.
When going for gz+packing, there is no need to uncompress an entire
pack file just to start reading a single pristine. You can just keep
offsets (in wc.db or whatever) to where the individual compressed
pristines exist inside the pack file.
Why not simply compress the "shards" we already have in the pristine
store (sharded by the first two characters of the pristine checksum)?
Or do we run the risk that such compressed shards are going to become
too large (e.g. larger than 2 GB), and we want to avoid such a thing?
--
Johan
Re: Compressed Pristines (Simulation)
Posted by Ashod Nakashian <as...@yahoo.com>.
----- Original Message -----
> From: Ivan Zhakov <iv...@visualsvn.com>
> To: Ashod Nakashian <as...@yahoo.com>
> Cc: "dev@subversion.apache.org" <de...@subversion.apache.org>
> Sent: Sunday, March 25, 2012 10:55 PM
> Subject: Re: Compressed Pristines (Simulation)
>
> On Sun, Mar 25, 2012 at 21:17, Ashod Nakashian <as...@yahoo.com>
> wrote:
>> From this output it's clear how much waste there is due to internal
>> fragmentation and how much packing helps.
> Working (actual) files are already fragmented due filesystem block
> size. User can change file system or reduce block size if he cares. It
> not Subversion problem. And we should not spend resources to solve OS
> problems, let's focus on SVN.
We are attempting to reduce the disk usage of SVN pristine store and, if possible, improve overall SVN performance. SVN currently has a 100% overhead in terms of disk space and file count per WC. Sure we can't help number of files and fragmentation for the checked out versions, but the pristine store design is completely SVN's and therefore the user pays the price of that design. Currently, the overhead of the pristine store is high and so it's an SVN problem to improve the situation for its users. If that involves file systems and other unrelated topics, then that's what we have to be measuring and talking about.
-Ash
>
> --
> Ivan Zhakov
>
Re: Compressed Pristines (Simulation)
Posted by Branko Čibej <br...@apache.org>.
On 25.03.2012 19:55, Ivan Zhakov wrote:
> On Sun, Mar 25, 2012 at 21:17, Ashod Nakashian <as...@yahoo.com> wrote:
>> From this output it's clear how much waste there is due to internal
>> fragmentation and how much packing helps.
> Working (actual) files are already fragmented due filesystem block
> size. User can change file system or reduce block size if he cares. It
> not Subversion problem. And we should not spend resources to solve OS
> problems, let's focus on SVN.
Well, "let's focus on SVN" sort of implies "don't care about filesystem
block allocaiton," doesn't it. :)
-- Brane
Re: Compressed Pristines (Simulation)
Posted by Ivan Zhakov <iv...@visualsvn.com>.
On Sun, Mar 25, 2012 at 21:17, Ashod Nakashian <as...@yahoo.com> wrote:
> From this output it's clear how much waste there is due to internal
> fragmentation and how much packing helps.
Working (actual) files are already fragmented due filesystem block
size. User can change file system or reduce block size if he cares. It
not Subversion problem. And we should not spend resources to solve OS
problems, let's focus on SVN.
--
Ivan Zhakov
Re: Compressed Pristines (Simulation)
Posted by Ashod Nakashian <as...@yahoo.com>.
All,
Comments and simulation results in-line.
>________________________________
> From: Hyrum K Wright <hy...@wandisco.com>
[snip]
>
>So, I've read through the design document, and the various threads,
>and have a couple of comments / questions which I don't think have
>been addressed. My first impression, though is to give you major
>kudos for going through the effort to research and think about this
>complex and subtle problem. Now my thoughts...
>
>As mentioned elsewhere, I too was surprised by the choice of a custom
>container, though I think you make a good argument for it. One
>simplification I was thinking about is this: what if the container
>only needed to support add and batch-delete operations? These are the
>current contraints of the existing pristine store; would they
>introduce additional simplicity into your design?
These are indeed the two main operations. Splitting and repacking (aka defragmenting) aren't basic operations per-se, they're housekeeping, but necessary ones if we care about disk space saving and performance (principle requirements for this feature).
>
>In some respects, it looks like you're solving *two* problems:
>compression and the internal fragmentation due to large FS block
>sizes. How orthogonal are the problems? Could they be solved
>independently of each other in some way? I know that compression
>exposes the internal fragmentation issue, but used alone it certainly
>doesn't make things *worse* does it?
Compression exposes internal fragmentation and, yes, it makes it *worse* (see hard numbers below).
Therefore, compression and internal fragmentation are orthogonal only if we care about absolute savings. (In other words, compressed files cause more internal fragmentation, but overall footprint is still reduced, however not as efficiently as ultimately possible.)
>
>Finally, in all the above let's not let "the perfect be the enemy of
>the good." If something *simple* will give us demonstrable
>performance improvements now, can we do so without limiting out
>ability to do a more complex and complete solution later?
That is very possible, although it comes with a price tag. Namely, maintenance. Unless it's an internal experimental change, releasing a simple solution to the public will potentially hinder replacing it with an improved version. But nothing is preventing us from doing things incrementally. Again, see below for more info.
>
>Anyway, good work, and here's hoping it yield fruit.
Thanks! The pleasure is all mine :)
>
>-Hyrum
>
Greg voiced a similar suggestion of a simple solution that can be improved later:
----- Original Message -----
> From: Greg Stein <gs...@gmail.com>
[snip]
> For simplicity's sake, I would recommend an initial solution using
> wc.db for the metadata. You could then write a test to see whether a
> custom format would significantly outperform sqlite, and discussion a
> change at that point.
>
> IOW, do not "prematurely optimize". Go with the straightforward
> sqlite-based solution and test/validate the speed in a future review.
>
> Cheers,
> -g
Since the debated techniques (individual gz files vs packing+gz) for implementing Compressed Pristines are within reach with existing tools, and indeed some tests were done to yield hard figures (see older messages in this thread), it's reasonable to run simulations that can show with hard numbers the extent to which the speculations and estimations done (mostly by yours truly) regarding the advantages of a custom pack file are justifiable.
To bring everyone on the same page, the proposed custom pack file is promising significant reduction in disk space thanks to combining pristine files before compression, sorting them and packing into large files (but balanced for performance) to reduce internal fragmentation to a minimum (aka sub-block waste). The competing alternative is to simply compress the individual pristine files in their place (gzip them basically) at least as a first-step. A compromising solution has been suggested to reduce internal fragmentation (which percentage wise affects small files more) by placing "small" files in an/the sqlite database file (for some threshold for smallness). The argument against the latter suggestion is that we can't exploit inter-file similarities in sqlite blobs and therefore we'll only save the sub-block waste (which if the simulation is of any value, it's significant).
The simulation script (attached) does the following:
Checkout a given WC.
Collect file stats (count, total size, total size on disk) for the Pristine Store.
gzip individual files.
bzip2 individual files.
cat all files then gzip.
cat all files then bzip2.
cat all files sorted by extension then filename then gzip.
cat all files sorted by extension then filename then bzip2.
The total sizes are collected and compared in absolute bytes and percentages. The simulation attempts to demonstrate the advantages of packing files before compression and packing files sorted first against simply compressing individual files in-place. In addition, the simulation hopes to show that gzip is outdated and superior compressors will yield significant gains, especially when packing and sorting. Bzip2 isn't the last word in general purpose compression and there are superior algorithms/implementations, but it's used to give us a feel of how much packing and sorting can affect the results given a compressor that can exploit them better. Ideally, a compressor that is as fast as gzip and more efficient than bzip2 is hoped for.
NOTE: In all cases, except for sorting, the actual pristine files were used. This is because they are duplicate free (which would benefit the packing as it can exploit inter-file similarities). However for sorting the original file-names are necessary which the PS lacks. In addition, I *did* want the packing approach to benefit from duplicates because in a WC that has multiple tags/branches packing sorted files will yield superior results thanks to inter-file similarities.
Here is a sample output:
::Subversion Compressed Pristines Simulation::
Disk block-size is 4096 bytes.
Checking out http://svn.apache.org/repos/asf/subversion/trunk/
svn: .svn-base is 44730415 bytes in 1882 files, 23767 average file size. Sub-block waste 3942353 (8.81%)
svn: .svn-base.GZ is 16044735 bytes in 1882 files, 8525 average gz file size. Sub-block waste 4644161 (28.94%)
svn: .svn-base.BZ2 is 15146221 bytes in 1882 files, 8047 average bzip2 file size. Sub-block waste 4563731 (30.13%)
svn: .svn-base.GZ saves 27983872 bytes, .svn-base.BZ2 saves 28962816 bytes (57.49% and 59.50%) respectively.
svn: .svn-base is 48672768 bytes on disk, .svn-base.GZ is 20688896 bytes on disk, .svn-text.BZ2 is 19709952 bytes on disk.
svn: GZ Pack is 14295040 bytes on disk, BZ2 Pack is 13062144 bytes on disk. Saved 34377728 and 35610624 bytes (70.63% and 73.16%) respectively.
svn: GZ pack saves 6393856 bytes (69.09%) compared to .svn-base.GZ.
svn: BZ2 pack saves 6647808 bytes (66.27%) compared to .svn-base.BZ2.
svn: GZ Sorted Pack is 13832192 bytes on disk, BZ2 Sorted Pack is 12128256 bytes on disk. Saved 34840576 and 36544512 bytes (71.58% and 75.08%) respectively.
svn: pristine files: 48672768 bytes on disk.
svn: in-place gz: 20688896 bytes (42.50% of original)
svn: in-place bz2: 19709952 bytes (40.49% of original)
svn: packed gz: 14295040 bytes (29.36% of original)
svn: packed bz2: 13062144 bytes (26.83% of original)
svn: sorted packed gz: 13832192 bytes (28.41% of original)
svn: sorted packed bz2: 12128256 bytes (24.91% of original)
Checking out svn://gcc.gnu.org/svn/gcc/trunk
gcc: .svn-base is 444058945 bytes in 75223 files, 5903 average file size. Sub-block waste 217023167 (48.87%)
gcc: .svn-base.GZ is 137009307 bytes in 75223 files, 1821 average gz file size. Sub-block waste 247084901 (180.34%)
gcc: .svn-base.BZ2 is 127560017 bytes in 75223 files, 1695 average bzip2 file size. Sub-block waste 246343343 (193.11%)
gcc: .svn-base.GZ saves 276987904 bytes, .svn-base.BZ2 saves 287178752 bytes (41.89% and 43.44%) respectively.
gcc: .svn-base is 661082112 bytes on disk, .svn-base.GZ is 384094208 bytes on disk, .svn-text.BZ2 is 373903360 bytes on disk.
gcc: GZ Pack is 109268992 bytes on disk, BZ2 Pack is 91897856 bytes on disk. Saved 551813120 and 569184256 bytes (83.47% and 86.09%) respectively.
gcc: GZ pack saves 274825216 bytes (28.44%) compared to .svn-base.GZ.
gcc: BZ2 pack saves 282005504 bytes (24.57%) compared to .svn-base.BZ2.
gcc: GZ Sorted Pack is 94666752 bytes on disk, BZ2 Sorted Pack is 73170944 bytes on disk. Saved 566415360 and 587911168 bytes (85.68% and 88.93%) respectively.
gcc: pristine files: 661082112 bytes on disk.
gcc: in-place gz: 384094208 bytes (58.10% of original)
gcc: in-place bz2: 373903360 bytes (56.55% of original)
gcc: packed gz: 109268992 bytes (16.52% of original)
gcc: packed bz2: 91897856 bytes (13.90% of original)
gcc: sorted packed gz: 94666752 bytes (14.31% of original)
gcc: sorted packed bz2: 73170944 bytes (11.06% of original)
From this output it's clear how much waste there is due to internal fragmentation and how much packing helps. What we should notice is that SVN is indeed smallish with only 1882 files averaging 23767 bytes / file. Although in-place compression gives almost 60% reduction in disk space (thanks to largish files), sorting+packing+gzip can cross the 70% mark and bzip crosses the 75% point. Here sorting+packing is almost 150% more efficient than in-place gzip.
With GCC the picture is quite different. With 75000+ files averaging 5900 bytes, there is almost 49% wasted to internal fragmentation. When compressed individually, the waste jumps to 180% and 193% for gzip and bzip2 respectively. It is therefore no surprise that while in-place gzip saves over 40% of the disk space, with sorting+packing+gzip we cross the 85% threshold and with bzip2 we almost hit 89%. That is, sorting+packing is 400-500% more efficient than in-place gzip.
Another important point, besides the advantages of having custom pack files, is the reduction in the number of files on disk. So even if these numbers are too good to be true in practice, reducing the number of files in the pristine store will alleviate pressure on the FS and should in most cases improve overall performance of pristine store operations (thanks to reducing IO operations, reducing kernel-mode transitions and file caching). It may be the case that we can't achieve the numbers above, due to the overheads of our solution, but we should asymptotically reach these numbers with improved compression and by balancing the overheads.
With multiple branches in the same WC the advantage of sorting+packing should grow even more, thanks to inter-file similarity exploitation, which in-place compression has no way of competing against. Unfortunately, checking out 10s of GBs and running millions of files through the compressors takes the better half of a day... at least with my resources. Everybody is welcome to run the simulation on their favorite repository and taste things for themselves. You're of course encouraged to share your findings with us, especially to confirm or contradict the results of my two case studies. Also, please do let me know if you think I goofed somewhere!
The bottom line of this simulation is to give us more information to make better, more educated, decisions. What I hope to have achieved is, at the expense of a few good hours from my weekend, that I will have saved many more good hours for the members of the SVN community. I'm not here to make decisions or suggestions, so I'll leave you with the hard numbers and my opinion that there must be a sweet spot between the naive and the extreme approaches that will prove best to the community at large.
Cheers,
Ash
Re: Compressed Pristines (Design Doc)
Posted by Ashod Nakashian <as...@yahoo.com>.
----- Original Message -----
> From: Daniel Shahaf <da...@elego.de>
> To: Hyrum K Wright <hy...@wandisco.com>
> Cc: Ashod Nakashian <as...@yahoo.com>; "dev@subversion.apache.org" <de...@subversion.apache.org>; Philip Martin <ph...@wandisco.com>; Greg Stein <gs...@gmail.com>
> Sent: Monday, March 26, 2012 5:30 PM
> Subject: Re: Compressed Pristines (Design Doc)
>
> Hyrum K Wright wrote on Fri, Mar 23, 2012 at 13:54:25 -0500:
>> As mentioned elsewhere, I too was surprised by the choice of a custom
>> container, though I think you make a good argument for it. One
>> simplification I was thinking about is this: what if the container
>> only needed to support add and batch-delete operations? These are the
>> current contraints of the existing pristine store; would they
>> introduce additional simplicity into your design?
>>
>> In some respects, it looks like you're solving *two* problems:
>> compression and the internal fragmentation due to large FS block
>> sizes. How orthogonal are the problems? Could they be solved
>> independently of each other in some way? I know that compression
>> exposes the internal fragmentation issue, but used alone it certainly
>> doesn't make things *worse* does it?
>>
>
> Personally I've also been wondering, while reading the design doc, how
> applicable are the solutions to libsvn_fs -- or if they could be
> modularized in a way that lets libsvn_fs re-use parts of them, etc.
>
> I haven't found much so far, but this is another angle to look at things
> from.
>
This is certainly something to plan for. I didn't include such info to avoid widening the scope and because we haven't agreed on the design yet. I'll probably get to that when we have consensus on the design, which will hopefully be soon.
-Ash
Re: Compressed Pristines (Design Doc)
Posted by Daniel Shahaf <da...@elego.de>.
Daniel Shahaf wrote on Mon, Mar 26, 2012 at 14:30:34 +0200:
> I haven't found much so far
(Provided as an observation; not implying it's a problem.)
Re: Compressed Pristines (Design Doc)
Posted by Daniel Shahaf <da...@elego.de>.
Hyrum K Wright wrote on Fri, Mar 23, 2012 at 13:54:25 -0500:
> As mentioned elsewhere, I too was surprised by the choice of a custom
> container, though I think you make a good argument for it. One
> simplification I was thinking about is this: what if the container
> only needed to support add and batch-delete operations? These are the
> current contraints of the existing pristine store; would they
> introduce additional simplicity into your design?
>
> In some respects, it looks like you're solving *two* problems:
> compression and the internal fragmentation due to large FS block
> sizes. How orthogonal are the problems? Could they be solved
> independently of each other in some way? I know that compression
> exposes the internal fragmentation issue, but used alone it certainly
> doesn't make things *worse* does it?
>
Personally I've also been wondering, while reading the design doc, how
applicable are the solutions to libsvn_fs -- or if they could be
modularized in a way that lets libsvn_fs re-use parts of them, etc.
I haven't found much so far, but this is another angle to look at things
from.
Re: Compressed Pristines (Design Doc)
Posted by Hyrum K Wright <hy...@wandisco.com>.
On Wed, Mar 21, 2012 at 2:19 PM, Ashod Nakashian
<as...@yahoo.com> wrote:
> All,
>
> I'm happy to share[1] with you the design document for the Compressed
> Pristines feature. The document is public and anyone can comment on any part
> (select, right-click and comment away). If you'd like to get *editing*
> permission, please email me and I'll add you to the list of editors.
>
> I'm sure there will be much to criticize and debate, I'd love to hear all
> input, but being pragmatic, I also would like to a) experiment and figure
> out the best approach in practice, backed with real data and consensus and
> b) to finish this feature rather than debate forever (it's been debated for
> almost a decade this December!).
>
> As such, what's not clear, I've left out or written TBD notes and at the
> same time I've already made experimental changes locally to have a more
> learned information rather than an academic design (this, not to mention
> reading 100s of dev-list mails). I made a serious attempt at specifying as
> much of the hard facts/reqs/goals as possible to narrow the scope and avoid
> feature-creep.
>
> I'd like to take this feature on a "lightweight branch" and start committing
> code and getting reviews (and contributions!!) while we finalize the design
> and decide on the details (those who can create branches and grant commit
> rights please let me know when is the right time to do this - I'm ready and
> have code to commit and develop further).
>
> I thank everyone who will help us get this finally done in advance and look
> forward to hearing from you all.
> -Ash
>
> [1] https://docs.google.com/document/d/1ktIsewfMBMVBxbn-Ng8NwkNwAS_QJ6eC7GOygsbBeEc/edit
So, I've read through the design document, and the various threads,
and have a couple of comments / questions which I don't think have
been addressed. My first impression, though is to give you major
kudos for going through the effort to research and think about this
complex and subtle problem. Now my thoughts...
As mentioned elsewhere, I too was surprised by the choice of a custom
container, though I think you make a good argument for it. One
simplification I was thinking about is this: what if the container
only needed to support add and batch-delete operations? These are the
current contraints of the existing pristine store; would they
introduce additional simplicity into your design?
In some respects, it looks like you're solving *two* problems:
compression and the internal fragmentation due to large FS block
sizes. How orthogonal are the problems? Could they be solved
independently of each other in some way? I know that compression
exposes the internal fragmentation issue, but used alone it certainly
doesn't make things *worse* does it?
Finally, in all the above let's not let "the perfect be the enemy of
the good." If something *simple* will give us demonstrable
performance improvements now, can we do so without limiting out
ability to do a more complex and complete solution later?
Anyway, good work, and here's hoping it yield fruit.
-Hyrum
--
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/
Re: Compressed Pristines (Design Doc)
Posted by Ashod Nakashian <as...@yahoo.com>.
All,
I'm happy to share[1] with you the design document for the Compressed Pristines feature. The document is public and anyone can comment on any part (select, right-click and comment away). If you'd like to get *editing* permission, please email me and I'll add you to the list of editors.
I'm sure there will be much to criticize and debate, I'd love to hear all input, but being pragmatic, I also would like to a) experiment and figure out the best approach in practice, backed with real data and consensus and b) to finish this feature rather than debate forever (it's been debated for almost a decade this December!).
As such, what's not clear, I've left out or written TBD notes and at the same time I've already made experimental changes locally to have a more learned information rather than an academic design (this, not to mention reading 100s of dev-list mails). I made a serious attempt at specifying as much of the hard facts/reqs/goals as possible to narrow the scope and avoid feature-creep.
I'd like to take this feature on a "lightweight branch" and start committing code and getting reviews (and contributions!!) while we finalize the design and decide on the details (those who can create branches and grant commit rights please let me know when is the right time to do this - I'm ready and have code to commit and develop further).
I thank everyone who will help us get this finally done in advance and look forward to hearing from you all.
-Ash
[1] https://docs.google.com/document/d/1ktIsewfMBMVBxbn-Ng8NwkNwAS_QJ6eC7GOygsbBeEc/edit
>________________________________
> From: Hyrum K Wright <hy...@wandisco.com>
>To: Ashod Nakashian <as...@yahoo.com>
>Cc: Philip Martin <ph...@wandisco.com>; Greg Stein <gs...@gmail.com>; "dev@subversion.apache.org" <de...@subversion.apache.org>
>Sent: Monday, March 12, 2012 5:31 PM
>Subject: Re: Compressed Pristines
>
>On Mon, Mar 12, 2012 at 7:11 AM, Ashod Nakashian
><as...@yahoo.com> wrote:
>> ----- Original Message -----
>>
>>> From: Philip Martin <ph...@wandisco.com>
>>> To: Ashod Nakashian <as...@yahoo.com>
>>> Cc: Greg Stein <gs...@gmail.com>; "dev@subversion.apache.org" <de...@subversion.apache.org>
>>> Sent: Monday, March 12, 2012 2:40 PM
>>> Subject: Re: Compressed Pristines
>>>
>>> Ashod Nakashian <as...@yahoo.com> writes:
>>>
>>>> * Are there any documentation/design/discussions on this feature that
>>>> I could study?
>>>
>>> There has been some discussion in the past on the dev list. I don't
>>> think it is written down anywhere else.
>>>
>>>> * Who should coordinate and be contacted on decision points?
>>>
>>> The dev list.
>>>
>>>> * I know this feature was planned for 1.8. Is that still reasonable?
>>>> (I can't find a release date for 1.8) Will 1.8 wait for this or has
>>>> this feature been demoted to a low-priority in general? The reason I
>>>> ask is to have a vague idea as to how close this feature is on the
>>>> critical path to future releases.
>>>
>>> We don't plan like that. The features that will go into 1.8 are the
>>> features people choose to write.
>>
>> Got it. Thanks.
>>
>> Here is my plan. I'll study whatever discussion took place on dev-list. My main technical concern is related to any complications that aren't obvious (due to design or requirements elsewhere in svn). I'll come up with an architectural overview for the feature design and a breakdown of major milestones. When ready, I'll share them on this list and open it for discussion. Based on the results, code changes can commence.
>
>A few observations based upon my past poking around this area.
>
>The current implementation of the pristine store is designed to be
>"streamy." That is, external users aren't supposed to know or care
>where the actual contents live, or how they are accessed, but simply
>get a stream from which they can read and write the contents. In
>principle, this should make compressing said contents relatively easy,
>as we could just insert a compressing stream in this pipeline and
>everything would automagically work. Since this hasn't yet happened,
>you can probably guess that it isn't as easy as that. :)
>
>The primary issue when I looked at this problem was that the streamy
>abstraction is broken in several places, such as when we install the
>new pristine file. There are also certain consumers, such as a
>external diff tools, that require an uncompressed on-disk file to
>operate on, and we currently just provide the pristine as that file.
>Compressed pristines would require recreating the uncompressed version
>when such a tool is invoked. Whether this is a useful tradeoff, I
>don't know.
>
>Generally, though, I'm +1 for compressed pristines, as that was one of
>the design goals of wc-ng in the first place. (Oh, and extra points
>for selectively compressing pristines based upon mime-type.)
>
>So start digging in, asking on the dev@ list and #svn-dev on Freenode,
>and sending in patches. You'll find a community of folks eager for
>your input, and willing to help you.
>
>Hope that helps,
>-Hyrum
>
>
>--
>
>uberSVN: Apache Subversion Made Easy
>http://www.uberSVN.com/
>
>
>
Re: Compressed Pristines
Posted by Hyrum K Wright <hy...@wandisco.com>.
On Mon, Mar 12, 2012 at 7:11 AM, Ashod Nakashian
<as...@yahoo.com> wrote:
> ----- Original Message -----
>
>> From: Philip Martin <ph...@wandisco.com>
>> To: Ashod Nakashian <as...@yahoo.com>
>> Cc: Greg Stein <gs...@gmail.com>; "dev@subversion.apache.org" <de...@subversion.apache.org>
>> Sent: Monday, March 12, 2012 2:40 PM
>> Subject: Re: Compressed Pristines
>>
>> Ashod Nakashian <as...@yahoo.com> writes:
>>
>>> * Are there any documentation/design/discussions on this feature that
>>> I could study?
>>
>> There has been some discussion in the past on the dev list. I don't
>> think it is written down anywhere else.
>>
>>> * Who should coordinate and be contacted on decision points?
>>
>> The dev list.
>>
>>> * I know this feature was planned for 1.8. Is that still reasonable?
>>> (I can't find a release date for 1.8) Will 1.8 wait for this or has
>>> this feature been demoted to a low-priority in general? The reason I
>>> ask is to have a vague idea as to how close this feature is on the
>>> critical path to future releases.
>>
>> We don't plan like that. The features that will go into 1.8 are the
>> features people choose to write.
>
> Got it. Thanks.
>
> Here is my plan. I'll study whatever discussion took place on dev-list. My main technical concern is related to any complications that aren't obvious (due to design or requirements elsewhere in svn). I'll come up with an architectural overview for the feature design and a breakdown of major milestones. When ready, I'll share them on this list and open it for discussion. Based on the results, code changes can commence.
A few observations based upon my past poking around this area.
The current implementation of the pristine store is designed to be
"streamy." That is, external users aren't supposed to know or care
where the actual contents live, or how they are accessed, but simply
get a stream from which they can read and write the contents. In
principle, this should make compressing said contents relatively easy,
as we could just insert a compressing stream in this pipeline and
everything would automagically work. Since this hasn't yet happened,
you can probably guess that it isn't as easy as that. :)
The primary issue when I looked at this problem was that the streamy
abstraction is broken in several places, such as when we install the
new pristine file. There are also certain consumers, such as a
external diff tools, that require an uncompressed on-disk file to
operate on, and we currently just provide the pristine as that file.
Compressed pristines would require recreating the uncompressed version
when such a tool is invoked. Whether this is a useful tradeoff, I
don't know.
Generally, though, I'm +1 for compressed pristines, as that was one of
the design goals of wc-ng in the first place. (Oh, and extra points
for selectively compressing pristines based upon mime-type.)
So start digging in, asking on the dev@ list and #svn-dev on Freenode,
and sending in patches. You'll find a community of folks eager for
your input, and willing to help you.
Hope that helps,
-Hyrum
--
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/
Re: Compressed Pristines
Posted by Ashod Nakashian <as...@yahoo.com>.
----- Original Message -----
> From: Philip Martin <ph...@wandisco.com>
> To: Ashod Nakashian <as...@yahoo.com>
> Cc: Greg Stein <gs...@gmail.com>; "dev@subversion.apache.org" <de...@subversion.apache.org>
> Sent: Monday, March 12, 2012 2:40 PM
> Subject: Re: Compressed Pristines
>
> Ashod Nakashian <as...@yahoo.com> writes:
>
>> * Are there any documentation/design/discussions on this feature that
>> I could study?
>
> There has been some discussion in the past on the dev list. I don't
> think it is written down anywhere else.
>
>> * Who should coordinate and be contacted on decision points?
>
> The dev list.
>
>> * I know this feature was planned for 1.8. Is that still reasonable?
>> (I can't find a release date for 1.8) Will 1.8 wait for this or has
>> this feature been demoted to a low-priority in general? The reason I
>> ask is to have a vague idea as to how close this feature is on the
>> critical path to future releases.
>
> We don't plan like that. The features that will go into 1.8 are the
> features people choose to write.
Got it. Thanks.
Here is my plan. I'll study whatever discussion took place on dev-list. My main technical concern is related to any complications that aren't obvious (due to design or requirements elsewhere in svn). I'll come up with an architectural overview for the feature design and a breakdown of major milestones. When ready, I'll share them on this list and open it for discussion. Based on the results, code changes can commence.
-Ash
>
> --
> uberSVN: Apache Subversion Made Easy
> http://www.uberSVN.com
>
Re: Compressed Pristines
Posted by Philip Martin <ph...@wandisco.com>.
Ashod Nakashian <as...@yahoo.com> writes:
> * Are there any documentation/design/discussions on this feature that
> I could study?
There has been some discussion in the past on the dev list. I don't
think it is written down anywhere else.
> * Who should coordinate and be contacted on decision points?
The dev list.
> * I know this feature was planned for 1.8. Is that still reasonable?
> (I can't find a release date for 1.8) Will 1.8 wait for this or has
> this feature been demoted to a low-priority in general? The reason I
> ask is to have a vague idea as to how close this feature is on the
> critical path to future releases.
We don't plan like that. The features that will go into 1.8 are the
features people choose to write.
--
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com
Re: Compressed Pristines
Posted by Ashod Nakashian <as...@yahoo.com>.
Thanks Greg for the quick reply. See inline please.
>________________________________
> From: Greg Stein <gs...@gmail.com>
>To: Ashod Nakashian <as...@yahoo.com>
>Cc: dev@subversion.apache.org
>Sent: Sunday, March 11, 2012 10:54 AM
>Subject: Re: Compressed Pristines
>
>
>To answer: no; nonexistent; yes.
>:-)
Where do I sign up! :-)
...but before I commit to working on this, I'd like to clarify a few things first.
* Are there any documentation/design/discussions on this feature that I could study?
* Who should coordinate and be contacted on decision points?
* I know this feature was planned for 1.8. Is that still reasonable? (I can't find a release date for 1.8) Will 1.8 wait for this or has this feature been demoted to a low-priority in general? The reason I ask is to have a vague idea as to how close this feature is on the critical path to future releases.
* Do we have a breakdown of this feature over a number of releases? For example the pristine copies may be packed together (as in Git) or stay as separate files (with a lot of slack space wasted for small files), yet compressing the individual files is still superior to the current state of affairs and packing is more complicated. We could implement compression for a first release, then add packing later. And even then, we could have an arbitrary complicated approach, such as delta-compression before entropy-compression, which in its turn could be shipped in a later release. These are questions that topic discussions should cover, which is why I asked for docs first.
* If work is restarted, do we have tentative volunteers? (I hate to commit to something I can't finish, and it's hard to bite at something too large).
Personally, I'd like to see this feature added. My experience gives me confidence that I can work on this. I'll be looking forward to getting some feedback and take it from there.
Thanks in advance,
Ash
>On Mar 10, 2012 11:59 PM, "Ashod Nakashian" <as...@yahoo.com> wrote:
>
>Hi All,
>>
>>I'm interested in the status of Compressed Pristines[1]. Is someone working on it? Where are the latest patches (a branch?). Do we need another hand to work on this feature?
>>
>>
>>[1] http://subversion.tigris.org/issues/show_bug.cgi?id=908
>>
>>
>>Thanks!
>>-Ash
>>
>
>
Re: Compressed Pristines
Posted by Greg Stein <gs...@gmail.com>.
To answer: no; nonexistent; yes.
:-)
On Mar 10, 2012 11:59 PM, "Ashod Nakashian" <as...@yahoo.com>
wrote:
> Hi All,
>
> I'm interested in the status of Compressed Pristines[1]. Is someone
> working on it? Where are the latest patches (a branch?). Do we need another
> hand to work on this feature?
>
>
> [1] http://subversion.tigris.org/issues/show_bug.cgi?id=908
>
>
> Thanks!
> -Ash
>