File: bench.sh

package info (click to toggle)
python-xxhash 3.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 232 kB
  • sloc: ansic: 1,314; python: 673; sh: 59; makefile: 7
file content (72 lines) | stat: -rwxr-xr-x 2,831 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash

PYTHON=${PYTHON-`which python`}

echo Benchmarking ...

echo -n "    xxh32_intdigest     1000B: "
$PYTHON -mtimeit -s 'from xxhash import xxh32_intdigest' \
                 -s 'import os'  \
                 -s 'import random' \
                 -s 'seed = random.randint(0, 0xffffffff)' \
                 -s 'data = os.urandom(1000)' \
                 'xxh32_intdigest(data, seed=seed)'

echo -n "    xxh32_intdigest    10000B: "
$PYTHON -mtimeit -s 'from xxhash import xxh32_intdigest' \
                 -s 'import os'  \
                 -s 'import random' \
                 -s 'seed = random.randint(0, 0xffffffff)' \
                 -s 'data = os.urandom(10000)' \
                 'xxh32_intdigest(data, seed=seed)'


echo -n "    xxh64_intdigest     1000B: "
$PYTHON -mtimeit -s 'from xxhash import xxh64_intdigest' \
                 -s 'import os'  \
                 -s 'import random' \
                 -s 'seed = random.randint(0, 0xffffffffffffffff)' \
                 -s 'data = os.urandom(1000)' \
                 'xxh64_intdigest(data, seed=seed)'

echo -n "    xxh64_intdigest    10000B: "
$PYTHON -mtimeit -s 'from xxhash import xxh64_intdigest' \
                 -s 'import os'  \
                 -s 'import random' \
                 -s 'seed = random.randint(0, 0xffffffffffffffff)' \
                 -s 'data = os.urandom(10000)' \
                 'xxh64_intdigest(data, seed=seed)'


echo -n "    xxh3_64_intdigest   1000B: "
$PYTHON -mtimeit -s 'from xxhash import xxh3_64_intdigest' \
                 -s 'import os'  \
                 -s 'import random' \
                 -s 'seed = random.randint(0, 0xffffffffffffffff)' \
                 -s 'data = os.urandom(1000)' \
                 'xxh3_64_intdigest(data, seed=seed)'

echo -n "    xxh3_64_intdigest  10000B: "
$PYTHON -mtimeit -s 'from xxhash import xxh3_64_intdigest' \
                 -s 'import os'  \
                 -s 'import random' \
                 -s 'seed = random.randint(0, 0xffffffffffffffff)' \
                 -s 'data = os.urandom(10000)' \
                 'xxh3_64_intdigest(data, seed=seed)'


echo -n "    xxh3_128_intdigest  1000B: "
$PYTHON -mtimeit -s 'from xxhash import xxh3_128_intdigest' \
                 -s 'import os'  \
                 -s 'import random' \
                 -s 'seed = random.randint(0, 0xffffffffffffffff)' \
                 -s 'data = os.urandom(1000)' \
                 'xxh3_128_intdigest(data, seed=seed)'

echo -n "    xxh3_128_intdigest 10000B: "
$PYTHON -mtimeit -s 'from xxhash import xxh3_128_intdigest' \
                 -s 'import os'  \
                 -s 'import random' \
                 -s 'seed = random.randint(0, 0xffffffffffffffff)' \
                 -s 'data = os.urandom(10000)' \
                 'xxh3_128_intdigest(data, seed=seed)'