| #!/usr/bin/env python3 | |
| from pathlib import Path | |
| import argparse | |
| def main(): | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument("--depth", type=int, default=5000) | |
| ap.add_argument("--out", default="messagepack-nested-5000.msgpack") | |
| args = ap.parse_args() | |
| out = Path(args.out) | |
| out.write_bytes((b"\x91" * args.depth) + b"\xc0") | |
| print(f"out={out}") | |
| print(f"depth={args.depth}") | |
| print(f"file_size={out.stat().st_size}") | |
| if __name__ == "__main__": | |
| main() | |