File: benchmark.py

package info (click to toggle)
siphashc 2.1-0.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 188 kB
  • sloc: ansic: 193; python: 141; makefile: 2
file content (17 lines) | stat: -rwxr-xr-x 390 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env python
"""
Simple timing benchmark.

Used for testing possible regressions when changing code.
"""

import timeit

print("Benchmark (short):")
print(timeit.timeit("siphash('0123456789ABCDEF', 'a')", "from siphashc import siphash"))
print("Benchmark (long):")
print(
    timeit.timeit(
        "siphash('0123456789ABCDEF', 'a' * 1000)", "from siphashc import siphash"
    )
)