mgutz / vpsbench

Benchmarks VPS perfomance
MIT License
323 stars 70 forks source link

Bzip compression test on urandom data? #10

Open tsundara opened 4 years ago

tsundara commented 4 years ago

This is regarding the test where you create a 25 mb file from urandom data to test Bzip speed (line 27-28)

    echo -n "Benching CPU. Bzipping 25MB file ... "
    dd if=/dev/urandom of=$tar_file bs=1024 count=25000 >>/dev/null 2>&1
    local tf=$( (/usr/bin/time -f "%es" tar cfj $tar_file.bz2 $tar_file) 2>&1 )

The compression time could vary based on the text content inside, even though the filesize is the same (compression algorithms are character based). I would try creating a file that has the same text content everywhere (let me know if I am missing anything)

Below is an example to create a series of numbers from 10m to 20m which creates an 86 mb file which will have same size, same text everywhere

seq 10000000 20000000 > seq.txt