Skip to content

Achieve 25% speedup in '--all-in-ram' mode#2

Merged
jjwhitney merged 4 commits intojjwhitney:masterfrom
trofi:master
Oct 31, 2012
Merged

Achieve 25% speedup in '--all-in-ram' mode#2
jjwhitney merged 4 commits intojjwhitney:masterfrom
trofi:master

Conversation

@trofi
Copy link
Contributor

@trofi trofi commented Oct 31, 2012

No description provided.

Sergei Trofimovich added 4 commits October 31, 2012 12:07
Make sure we don't modify data supplied by user.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
…static binary)

Usage example:
    make libbdelta.a bdelta LDFLAGS=-static

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
…more, than 4096 bytes

User can (And I did) pass large block sizes for initial passes,
but the code is not ready for it:

    match_backward() {
        ...
        if (numtoread > blocksize) numtoread = blocksize;
        Token buf1[4096], buf2[4096];
        const Token *read1 = b->read1(buf1, p1, numtoread),
        ...

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
libbdelta allows avoidance of temporary buffers if
caller guarantees persistence of read data.

--all-in-ram case is exactly this kind of workload!

Adjust memory reading function to just return pointer to data.

On my workload it speeds things up about ~25%

    time ./bdelta --all-in-ram win32.udb.{old,new,old-new.bdt}
    time bdelta --all-in-ram win32.udb.{old,new,old-new.bdt.orig}

    real    0m33.888s
    user    0m28.790s
    sys     0m2.316s

    real    0m39.990s
    user    0m35.116s
    sys     0m2.189s

win32.udb.old and  win32.udb.new are files 171MB sized,
patch is 27MB with 1 million of chunks.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
@jjwhitney
Copy link
Owner

Nice work!

jjwhitney added a commit that referenced this pull request Oct 31, 2012
Achieve 25% speedup in '--all-in-ram' mode
@jjwhitney jjwhitney merged commit f199354 into jjwhitney:master Oct 31, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants