On Wed, Sep 12, 2012 at 12:20 PM, Ivan Zhakov <i...@visualsvn.com> wrote:
> On Fri, Sep 7, 2012 at 12:56 PM, <stef...@apache.org> wrote: > > Author: stefan2 > > Date: Fri Sep 7 08:56:50 2012 > > New Revision: 1381938 > > > > URL: http://svn.apache.org/viewvc?rev=1381938&view=rev > > Log: > > Partly implements issue #3372: When building the rep state read > > sequence along the skip-delta chain, re-use file instances that > > pertain to the same pack file. > > > > * subversion/libsvn_fs_fs/fs_fs.c > > (create_rep_state_body): re-use the last file instance, if possible > > (create_rep_state): extended docstring to cover new parameters > > (build_rep_list): provide hints > > (read_window): seek before read as the file object may be shared > Hi Stefan, > > Did you consider using apr_file_dup2() to save disk access, but do not > worry about seek to right position when reading data? > No, I didn't. Duplicating the handle would be faster than opening the file "from scratch". But we would still have separate data buffers even if the reps and noderevs are located very close to each other. A common data buffer makes seek() a no-op in that case. SVN must seek to the begin of a delta window in any case. Doing it just before reading the window is not much of a problem. I will check whether we could now eliminate a seek during construction of the rep state. Only if a representation is larger than one window, we would be jumping back and forth. But that is one OS call per 100kB data chunk (minus deltification). BTW, my patch will *not* reduce the actual I/O but minimize the SVN <-> OS operation and data copying overhead. -- Stefan^2. -- * Join us this October at Subversion Live 2012<http://www.wandisco.com/svn-live-2012> for two days of best practice SVN training, networking, live demos, committer meet and greet, and more! Space is limited, so get signed up today<http://www.wandisco.com/svn-live-2012> ! *