proxmox-backup/examples
Fabian Grünbichler 00ce0e38bd example: improve chunking speed example
by dropping the print-per-chunk and making the input buffer size configurable
(8k is the default when using `new()`).

this allows benchmarking various input buffer sizes. basically the same code is
used for image-based backups in proxmox-backup-client, but just the
reading and chunking part. looking at the flame graphs the smaller input
buffer sizes clearly show most of time spent polling, instead of
reading+copying (or reading and scanning and copying).

for a fixed chunk size stream with a 16G input file on tmpfs:

fixed 1M ran
    1.06 ± 0.17 times faster than fixed 4M
    1.22 ± 0.11 times faster than fixed 16M
    1.25 ± 0.09 times faster than fixed 512k
    1.31 ± 0.10 times faster than fixed 256k
    1.55 ± 0.13 times faster than fixed 128k
    1.92 ± 0.15 times faster than fixed 64k
    3.09 ± 0.31 times faster than fixed 32k
    4.76 ± 0.32 times faster than fixed 16k
    8.08 ± 0.59 times faster than fixed 8k

(from 15.275s down to 1.890s)

dynamic chunk stream, same input:

dynamic 4M ran
    1.01 ± 0.03 times faster than dynamic 1M
    1.03 ± 0.03 times faster than dynamic 16M
    1.06 ± 0.04 times faster than dynamic 512k
    1.07 ± 0.03 times faster than dynamic 128k
    1.12 ± 0.03 times faster than dynamic 64k
    1.15 ± 0.20 times faster than dynamic 256k
    1.23 ± 0.03 times faster than dynamic 32k
    1.47 ± 0.04 times faster than dynamic 16k
    1.92 ± 0.05 times faster than dynamic 8k

(from 26.5s down to 13.772s)

same input file on ext4 on LVM on CT2000P5PSSD8 (with caches dropped for each run):

fixed 4M ran
   1.06 ± 0.02 times faster than fixed 16M
   1.10 ± 0.01 times faster than fixed 1M
   1.12 ± 0.01 times faster than fixed 512k
   1.15 ± 0.02 times faster than fixed 128k
   1.17 ± 0.01 times faster than fixed 256k
   1.22 ± 0.02 times faster than fixed 64k
   1.55 ± 0.05 times faster than fixed 32k
   2.00 ± 0.07 times faster than fixed 16k
   3.01 ± 0.15 times faster than fixed 8k

(from 19.807s down to 6.574s)

dynamic 4M ran
    1.04 ± 0.02 times faster than dynamic 512k
    1.04 ± 0.02 times faster than dynamic 128k
    1.04 ± 0.02 times faster than dynamic 16M
    1.06 ± 0.02 times faster than dynamic 1M
    1.06 ± 0.02 times faster than dynamic 256k
    1.08 ± 0.02 times faster than dynamic 64k
    1.16 ± 0.02 times faster than dynamic 32k
    1.34 ± 0.03 times faster than dynamic 16k
    1.70 ± 0.04 times faster than dynamic 8k

(from 31.184s down to 18.378s)

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-07-19 10:05:14 +02:00
..
cipherbench.rs update zstd to 0.12 2023-05-21 15:32:45 +02:00
completion.rs examples: rust fmt 2022-04-10 17:44:34 +02:00
download-speed.rs accept a ref to a HttpClient 2023-11-25 17:07:42 +01:00
dynamic-files.rs examples: rust fmt 2022-04-10 17:44:34 +02:00
h2client.rs use new proxmox-async crate 2021-11-19 18:03:22 +01:00
h2s-client.rs use new proxmox-async crate 2021-11-19 18:03:22 +01:00
h2s-server.rs use new proxmox-async crate 2021-11-19 18:03:22 +01:00
h2server.rs use new proxmox-async crate 2021-11-19 18:03:22 +01:00
tape-write-benchmark.rs examples: add tape write benchmark 2024-05-08 09:04:52 +02:00
test_chunk_size.rs datastore: chunker: add Chunker trait 2024-06-05 16:39:42 +02:00
test_chunk_speed2.rs example: improve chunking speed example 2024-07-19 10:05:14 +02:00
test_chunk_speed.rs datastore: chunker: add Chunker trait 2024-06-05 16:39:42 +02:00
upload-speed.rs client: backup writer: only borrow http client 2024-04-04 10:51:45 +02:00