Skip to content

Commit d95f736

Browse files
committed
test: gather baselines for serialize bench
We would only have baselines for Intel. We now can run this test on all supported CPUs. Signed-off-by: Diana Popa <[email protected]>
1 parent e81013c commit d95f736

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

tests/integration_tests/performance/test_versioned_serialization_benchmark.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
import logging
77
import json
88
import shutil
9+
import platform
910

10-
import pytest
1111
from framework import utils
12-
from framework.utils_cpuid import CpuVendor, get_cpu_vendor
1312
from framework.defs import FC_WORKSPACE_DIR
1413
from host_tools import proc
1514

1615
BENCHMARK_DIRECTORY = "{}/src/vmm".format(FC_WORKSPACE_DIR)
16+
DEFAULT_BUILD_TARGET = "{}-unknown-linux-musl".format(platform.machine())
1717

1818
PROC_MODEL = proc.proc_type()
1919

@@ -27,27 +27,27 @@
2727
},
2828
"deserialize": {
2929
"no-crc": {"target": 0.034, "delta": 0.015}, # milliseconds # milliseconds
30-
"crc": {"target": 0.042, "delta": 0.015}, # milliseconds # milliseconds
30+
"crc": {"target": 0.042, "delta": 0.020}, # milliseconds # milliseconds
3131
},
3232
},
3333
"AMD": {
3434
"serialize": {
35-
"no-crc": {"target": 0.096, "delta": 0.025}, # milliseconds # milliseconds
36-
"crc": {"target": 0.122, "delta": 0.025}, # milliseconds # milliseconds
35+
"no-crc": {"target": 0.084, "delta": 0.05}, # milliseconds # milliseconds
36+
"crc": {"target": 0.108, "delta": 0.025}, # milliseconds # milliseconds
3737
},
3838
"deserialize": {
39-
"no-crc": {"target": 0.037, "delta": 0.015}, # milliseconds # milliseconds
40-
"crc": {"target": 0.045, "delta": 0.015}, # milliseconds # milliseconds
39+
"no-crc": {"target": 0.070, "delta": 0.02}, # milliseconds # milliseconds
40+
"crc": {"target": 0.052, "delta": 0.04}, # milliseconds # milliseconds
4141
},
4242
},
4343
"ARM": {
4444
"serialize": {
45-
"no-crc": {"target": 0.096, "delta": 0.025}, # milliseconds # milliseconds
46-
"crc": {"target": 0.186, "delta": 0.025}, # milliseconds # milliseconds
45+
"no-crc": {"target": 0.05, "delta": 0.02}, # milliseconds # milliseconds
46+
"crc": {"target": 0.054, "delta": 0.02}, # milliseconds # milliseconds
4747
},
4848
"deserialize": {
49-
"no-crc": {"target": 0.034, "delta": 0.015}, # milliseconds # milliseconds
50-
"crc": {"target": 0.042, "delta": 0.015}, # milliseconds # milliseconds
49+
"no-crc": {"target": 0.057, "delta": 0.02}, # milliseconds # milliseconds
50+
"crc": {"target": 0.063, "delta": 0.02}, # milliseconds # milliseconds
5151
},
5252
},
5353
}
@@ -75,7 +75,6 @@ def _check_statistics(directory, mean):
7575
return directory, f"{mean} ms", f"{low} <= result <= {high}"
7676

7777

78-
@pytest.mark.skipif(get_cpu_vendor() != CpuVendor.INTEL, reason="Not supported yet.")
7978
def test_serialization_benchmark():
8079
"""
8180
Benchmark test for MicrovmState serialization/deserialization.
@@ -88,7 +87,7 @@ def test_serialization_benchmark():
8887
os.chdir(BENCHMARK_DIRECTORY)
8988

9089
# Run benchmark test
91-
cmd = "cargo bench"
90+
cmd = "cargo bench --target {}".format(DEFAULT_BUILD_TARGET)
9291
result = utils.run_cmd_sync(cmd)
9392
assert result.returncode == 0
9493

@@ -115,7 +114,7 @@ def test_serialization_benchmark():
115114
mean = estimates["mean"]["point_estimate"] / NSEC_IN_MSEC
116115
logger.info("Mean: %f", mean)
117116

118-
res = _check_statistics(directory, mean)
117+
res = _check_statistics(directory, round(mean, 3))
119118

120119
results_and_criteria[0] += f"{res[0]}: {res[1]}, "
121120
results_and_criteria[1] += f"{res[0]}: {res[2]}, "

0 commit comments

Comments
 (0)