{"id":21182612,"url":"https://github.com/fandreuz/python-serialization-benchmark","last_synced_at":"2026-04-12T18:51:49.969Z","repository":{"id":222392668,"uuid":"757127267","full_name":"fandreuz/python-serialization-benchmark","owner":"fandreuz","description":"Low-effort benchmark of several serialization libraries for scientific applications","archived":false,"fork":false,"pushed_at":"2024-02-16T21:45:55.000Z","size":37,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-21T14:45:12.243Z","etag":null,"topics":["avro","json","numpy","protobuf","python","serialization"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fandreuz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-13T21:22:55.000Z","updated_at":"2024-02-15T19:54:22.000Z","dependencies_parsed_at":"2024-02-14T00:21:30.571Z","dependency_job_id":"8c746c48-6c4f-4c60-8d65-64eb611fd5e2","html_url":"https://github.com/fandreuz/python-serialization-benchmark","commit_stats":null,"previous_names":["fandreuz/python-serialization-benchmark"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fandreuz%2Fpython-serialization-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fandreuz%2Fpython-serialization-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fandreuz%2Fpython-serialization-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fandreuz%2Fpython-serialization-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fandreuz","download_url":"https://codeload.github.com/fandreuz/python-serialization-benchmark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243652703,"owners_count":20325611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["avro","json","numpy","protobuf","python","serialization"],"created_at":"2024-11-20T17:57:30.246Z","updated_at":"2025-12-29T18:10:10.443Z","avatar_url":"https://github.com/fandreuz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python serialization benchmark\n\nA simple serialization benchmark for textual data and NumPy arrays. Results\nare obtained using `time.time_ns()`, and they are printed in nanoseconds.\n\n## Libraries\n\n- Avro\n- `json` (standard library)\n- orjson\n- pickle4\n- pickle5\n- Protocol Buffers\n- RapidJSON\n\n## Running the benchmark\n\n```bash\npodman run --interactive --tty --rm \\\n\t-v .:/home \\\n\t-w /home \\\n\t--env BENCHMARK_DATA_SIZE=$SIZE \\\n\t--env BENCHMARK_ITERATIONS=$ITERATIONS \\\n\tpython:$PY_VERSION \\\n\tsh -c \"./run_benchmark.sh\"\n```\n\n## Data type\n\n`--env BENCHMARK_TYPE=...`\n\n- `numeric` : See `benchmark/run/numeric_benchmark.py`\n- `textual` : See `benchmark/run/textual_benchmark.py`\n\n## Output\n\n### CSV\n\n`--env BENCHMARK_PP=csv` (default)\n```\nSerialization\nAvro,Json,Orjson,Pickle4,Pickle5,Protobuf,RapidJSON\n290244.85,26887717.19,1806935.09,48814.31,34544.63,78751.63,28539102.41\n\nDeserialization\nAvro,Json,Orjson,Pickle4,Pickle5,Protobuf,RapidJSON\n105083.1,11868387.1,2163872.31,19100.97,22108.22,33005.58,12793808.94\n```\n\n### PGFPlots\n\n`--env BENCHMARK_PP=pgfplot_histogram`\n```\nSerialization\n(AvroBackend,284676.57) (JsonBackend,28447828.45) (OrjsonBackend,2088943.27) (Pickle4Backend,50752.19) (Pickle5Backend,39036.18) (ProtobufBackend,82686.77) (RapidjsonBackend,31793210.02)\nDeserialization\n(AvroBackend,113478.34) (JsonBackend,12809206.11) (OrjsonBackend,2546817.87) (Pickle4Backend,20552.24) (Pickle5Backend,24479.14) (ProtobufBackend,34602.56) (RapidjsonBackend,14472453.05)\n```\n\n## Results aggregation\n\n`--env BENCHMARK_AGGREGATION=...`\n\n- `mean` : Mean\n- `min`/`max`: Min/max\n- `percentile99`: 99th percentile\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffandreuz%2Fpython-serialization-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffandreuz%2Fpython-serialization-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffandreuz%2Fpython-serialization-benchmark/lists"}