-
Notifications
You must be signed in to change notification settings - Fork 30
/
bench.sh
executable file
·72 lines (59 loc) · 2.76 KB
/
bench.sh
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)'