MCPcopy Create free account
hub / github.com/apache/fory / benchmark_args

Function benchmark_args

benchmarks/python/fory_benchmark.py:410–470  ·  view source on GitHub ↗

Parse command line arguments

()

Source from the content-addressed store, hash-verified

408
409
410def benchmark_args():
411 """Parse command line arguments"""
412 parser = argparse.ArgumentParser(description="Fory vs Pickle vs Msgpack Benchmark")
413 parser.add_argument(
414 "--operation",
415 type=str,
416 default="roundtrip",
417 choices=["roundtrip", "serialize", "deserialize"],
418 help="Benchmark operation mode: roundtrip, serialize, deserialize (default: roundtrip)",
419 )
420 parser.add_argument(
421 "--no-ref",
422 action="store_true",
423 default=False,
424 help="Disable reference tracking for Fory",
425 )
426 parser.add_argument(
427 "--disable-cython",
428 action="store_true",
429 default=False,
430 help="Use pure Python mode for Fory",
431 )
432 parser.add_argument(
433 "--benchmarks",
434 type=str,
435 default="all",
436 help="Comma-separated list of benchmarks to run. Available: dict, large_dict, "
437 "dict_group, tuple, large_tuple, large_float_tuple, large_boolean_tuple, "
438 "list, large_list, struct, slots_struct. Default: all",
439 )
440 parser.add_argument(
441 "--serializers",
442 type=str,
443 default="all",
444 help="Comma-separated list of serializers to benchmark. Available: fory, pickle, msgpack. Default: all",
445 )
446 parser.add_argument(
447 "--warmup",
448 type=int,
449 default=3,
450 help="Number of warmup iterations (default: 3)",
451 )
452 parser.add_argument(
453 "--iterations",
454 type=int,
455 default=20,
456 help="Number of benchmark iterations (default: 20)",
457 )
458 parser.add_argument(
459 "--repeat",
460 type=int,
461 default=5,
462 help="Number of times to repeat each iteration (default: 5)",
463 )
464 parser.add_argument(
465 "--number",
466 type=int,
467 default=1000,

Callers 1

micro_benchmarkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected