https://github.com/mupq/pqm4
Raw File
Tip revision: 1c27aa0803e555d6aee411f7bcefcd7833b12383 authored by Richard Petri on 16 January 2024, 20:54:18 UTC
Add MEDS
Tip revision: 1c27aa0
benchmarks.py
#!/usr/bin/env python3
from mupq import mupq
from interface import parse_arguments, get_platform
import sys

if __name__ == "__main__":
    args, rest = parse_arguments()
    platform, settings = get_platform(args)
    with platform:
        schemes = [s for s in rest if s not in ['--nostack',
                                                '--nospeed',
                                                '--nohashing',
                                                '--nosize']]
        if "--nostack" not in rest:
            test = mupq.StackBenchmark(settings, platform)
            if test.test_all(schemes):
                sys.exit(1)

        if "--nospeed" not in rest:
            test = mupq.SpeedBenchmark(settings, platform)
            if test.test_all(schemes):
                sys.exit(1)

        if "--nohashing" not in rest:
            test = mupq.HashingBenchmark(settings, platform)
            if test.test_all(schemes):
                sys.exit(1)

        if "--nosize" not in rest:
            test = mupq.SizeBenchmark(settings, platform)
            if test.test_all(schemes):
                sys.exit(1)
back to top