The sound distributed version control system

#761 zstd 1.4.9+ version is tragically slow

Closed on April 7, 2023
tankf33der on February 20, 2023

pijul record should finish in seconds on 100MB input file, not minutes.

How to check your target:

$ cd
$ pijul init p1
$ cd p1
$ dd if=/dev/zero of=testfile bs=1024 count=102400
102400+0 records in
102400+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.668095 s, 157 MB/s
$ pijul add testfile
$ time pijul rec -am"."
Hash: 53POTSWQJ7ZFD4FMVYFIDXX7Q3JST5DYBFJUE5UUKCYHWA6CJLNQC

real    2m29.584s
user    2m28.754s
sys     0m0.160s
$
tankf33der on February 20, 2023

Modern cheap laptop on version 1.4.9:

$ cd
$ pijul init p1
$ cd p1
$ dd if=/dev/zero of=testfile bs=1024 count=102400
102400+0 records in
102400+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0,520491 s, 201 MB/s
$ pijul add testfile
$ time pijul rec -am"."
Hash: EJ4FUWN7SGEQBLSZ4HIDM5MXFNT7YDEHWKI5WEMS5A4GA5WBE3LAC

real	0m1,220s
user	0m0,995s
sys	0m0,209s
$ 
tankf33der on February 21, 2023

Latest 1.5.4 still affected.

pmeunier on February 24, 2023

Even 1.4.9 was affected in my tests, although I’m not fully certain that Nix and Pkg-config did the right thing there.

Anyway, I just released zstd-seekable 0.1.10 with the fix.

pmeunier closed this discussion on February 24, 2023
tankf33der on February 24, 2023

I am 100% sure 1.4.9 is ok

tankf33der on February 24, 2023

I gonna open issue back for history. I see the same slow result after patches.

tankf33der reopened this discussion on February 24, 2023
pmeunier on February 28, 2023

Zstd-seekable 0.1.14 now embeds its own copy of ZStd and xxHash if it doesn’t find suitable versions using pkg-config.

These copies are compiled using the cc crate even on Windows, which also avoids embedding binary libs.

tankf33der on February 28, 2023

Will test another slow instance this evening and will close this discussion.

tankf33der on February 28, 2023

Fixed.

tankf33der closed this discussion on February 28, 2023
pmeunier on February 28, 2023

Finally! Compilation is also fixed on Windows. I submitted the issue to the ZStd folks, since we probably still want to get their updates in the future.

tankf33der on April 2, 2023

I am decided open this discussion again for history purpose. Current execution time on zstd 1.4.9+ is not optimal right now and pijul must be fast on any input and any zstd library version.

dd.sh script must end in second:

lambda:~/pijul-tests $ ./dd.sh 
+ source ./functions.sh
+ cd ..
+ rm -rf pijul-tests-data
+ mkdir pijul-tests-data
+ cd pijul-tests-data
+ pijul init repo
Repository created at repo
+ cd repo
+ dd if=/dev/zero of=a bs=1024 count=102400
102400+0 records in
102400+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0,306168 s, 342 MB/s
+ pijul add a
Tracked 1 path(s)
+ pijul record -am.
Hash: Y2IVDULQQ33LPAZDJMB5HKDZ7B4P2IAEP2VDEHV7VGSRFFYXJ6PQC

real	0m13,121s
user	0m12,935s
sys	0m0,075s
+ echo OK--dd
OK--dd
lambda:~/pijul-tests $ 
tankf33der reopened this discussion on April 2, 2023
tankf33der on April 2, 2023

As a solution you could create a crate to collect all required information and do benchmarking on target system.

tankf33der on April 2, 2023

This is a blocker for stable release.

tankf33der on April 2, 2023

Last comment about the subject: any vcs should (must?) write a commit or record a patch in speed of hdd and ~10MB/s or so is not ok. I want to record any branch of linux kernel in seconds.

tankf33der on April 5, 2023

Zstd 1.5.5 released, fingers crossed.

tankf33der on April 7, 2023

zstd 1.5.5 is a fix. Issue closed.

tankf33der closed this discussion on April 7, 2023