GithubHelp home page GithubHelp logo

fuchsde / orjson-benchmark Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 965 KB

Benchmarking Python JSON libraries compared to orjson.

License: Apache License 2.0

Python 100.00%
python json orjson ujson rapidjson simplejson benchmark serialization deserialization mac linux macos windows

orjson-benchmark's Introduction

Orjson-Benchmark

This repository is a copy of the benchmark to measure the performance and correctness of Python JSON libraries. It was copied and inspired from Orjson.

The goal is, using Poetry and Tox, to simplify the execution of the test and thus enable everyone to run the benchmark quickly.

Furthermore some improvements as naming the library version used and code refactoring were added.

To view the results visit the web app hosted on Heroku.

Reproducing the whole benchmark:

poetry run tox

Results can be found here:

Types

dataclass

Reproducing:

poetry run tox -e setup,update,dataclass

datetime

No benchmark available.

enum

No benchmark available.

float

No benchmark available.

int

No benchmark available.

numpy

Reproducing:

poetry run tox -e setup,update,numpy

str

No benchmark available.

nonstr

No benchmark available.

uuid

No benchmark available.

Correctness

No benchmark available.

Performance

Serialization and deserialization performance of orjson is better than ultrajson, rapidjson, simplejson, or json. The benchmarks are done on fixtures of real data:

  • twitter.json, 631.5KiB, results of a search on Twitter for "δΈ€", containing CJK strings, dictionaries of strings and arrays of dictionaries, indented.
  • github.json, 55.8KiB, a GitHub activity feed, containing dictionaries of strings and arrays of dictionaries, not indented.
  • citm_catalog.json, 1.7MiB, concert data, containing nested dictionaries of strings and arrays of integers, indented.
  • canada.json, 2.2MiB, coordinates of the Canadian border in GeoJSON format, containing floats and arrays, indented.

Latency

Reproducing:

poetry run tox -e setup,update,latency-dumps,latency-empty,latency-loads

Memory

Reproducing:

poetry run tox -e setup,update,memory

Other

Sorting

Reproducing:

poetry run tox -e setup,update,sort

Indent

Reproducing:

poetry run tox -e setup,update,indent

orjson-benchmark's People

Contributors

fuchsde avatar

Stargazers

 avatar

Watchers

 avatar

orjson-benchmark's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.