(operation: str, obj)
| 391 | |
| 392 | |
| 393 | def build_msgpack_benchmark_case(operation: str, obj): |
| 394 | if operation == "serialize": |
| 395 | if is_dataclass(obj): |
| 396 | return msgpack_serialize_dataclass, (obj,) |
| 397 | return msgpack_serialize, (obj,) |
| 398 | if operation == "deserialize": |
| 399 | if is_dataclass(obj): |
| 400 | return msgpack_deserialize_dataclass, ( |
| 401 | msgpack.dumps(make_msgpack_compatible(obj), use_bin_type=True), |
| 402 | obj, |
| 403 | ) |
| 404 | return msgpack_deserialize, (msgpack.dumps(obj, use_bin_type=True),) |
| 405 | if is_dataclass(obj): |
| 406 | return msgpack_roundtrip_dataclass, (obj,) |
| 407 | return msgpack_roundtrip, (obj,) |
| 408 | |
| 409 | |
| 410 | def benchmark_args(): |
no test coverage detected