A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://python-rapidjson.readthedocs.io/en/latest/benchmarks.html below:

Performance — python-rapidjson 1.17 documentation

Performance

python-rapidjson tries to be as performant as possible while staying compatible with the json module.

Tables

The following tables show a comparison between this module and other libraries with different data sets. Last row (“overall”) is the total time taken by all the benchmarks.

Each number shows the factor between the time taken by each contender and python-rapidjson (in other words, they are normalized against a value of 1.0 for python-rapidjson): the lower the number, the speedier the contender.

In bold the winner.

Serialization

serialize

dumps()[1]

Encoder()[2]

dumps(n)[3]

Encoder(n)[4]

PyEncoder()[5]

simdjson[6]

orjson[7]

ujson[8]

simplejson[9]

stdlib[10]

100 arrays dict

1.00

1.00

0.73

0.73

0.99

2.21

0.17

0.85

5.93

2.31

100 dicts array

1.00

0.99

0.77

0.74

1.01

2.27

0.22

0.84

6.82

2.27

256 Trues array

1.00

1.01

1.18

1.00

1.07

2.62

0.36

1.56

2.95

2.60

256 ascii array

1.00

1.00

1.01

1.00

1.00

0.90

0.09

0.47

1.05

0.90

256 doubles array

1.00

1.00

1.00

1.00

1.00

0.91

0.04

0.22

0.95

0.92

256 unicode array

1.00

0.80

0.79

0.82

0.80

0.68

0.02

0.52

0.66

0.68

apache.json

1.00

1.00

1.00

1.00

1.01

1.70

0.19

1.02

3.29

1.68

canada.json

1.00

1.00

0.98

0.99

1.00

1.04

0.06

0.27

1.81

1.05

complex object

1.00

1.00

0.89

0.88

1.00

1.55

0.17

0.66

2.68

1.54

composite object

1.00

0.99

0.68

0.64

0.98

1.70

0.21

0.83

2.48

1.72

ctm.json

1.00

1.00

0.75

0.75

1.00

2.27

0.21

1.11

6.56

2.27

github.json

1.00

1.00

0.97

0.96

1.00

1.38

0.16

0.86

2.10

1.39

instruments.json

1.00

1.00

0.74

0.74

1.00

1.81

0.20

0.90

2.86

1.81

mesh.json

1.00

1.00

0.89

0.89

1.00

0.94

0.10

0.28

1.19

0.94

truenull.json

1.00

1.02

1.06

1.03

1.03

2.13

0.28

1.76

2.12

2.21

tweet.json

1.00

1.00

0.99

0.93

1.00

1.70

0.20

0.91

2.70

1.69

twitter.json

1.00

1.00

0.95

0.95

1.00

1.46

0.18

0.94

2.02

1.46

overall

1.00

1.00

0.80

0.80

1.00

1.85

0.14

0.68

4.63

1.92

Deserialization

deserialize

loads()[11]

Decoder()[12]

loads(n)[13]

Decoder(n)[14]

PyDecoder()[15]

simdjson

orjson

ujson

simplejson

stdlib

100 arrays dict

1.00

1.01

0.98

0.93

1.59

0.86

0.56

0.85

1.20

0.94

100 dicts array

1.00

1.00

0.87

0.86

1.58

0.62

0.36

0.69

1.35

1.00

256 Trues array

1.00

1.02

1.08

0.98

1.14

0.93

0.42

0.96

1.53

1.37

256 ascii array

1.00

1.00

0.99

0.99

1.50

0.50

0.33

0.85

0.86

0.77

256 doubles array

1.00

1.00

0.26

0.26

1.01

0.21

0.16

0.61

1.08

1.03

256 unicode array

1.00

1.00

1.00

1.00

1.07

1.12

0.41

0.82

4.06

1.45

apache.json

1.00

1.00

1.01

1.01

1.57

0.68

0.44

0.79

0.84

0.82

canada.json

1.00

1.00

0.33

0.33

1.12

0.29

0.25

0.54

0.97

0.96

complex object

1.00

1.00

0.84

0.83

1.31

0.68

0.35

0.78

1.15

0.96

composite object

1.00

1.00

0.84

0.83

1.34

0.61

0.39

0.59

1.45

1.07

ctm.json

1.00

0.99

0.93

0.93

1.48

0.80

0.53

1.13

1.20

0.97

github.json

1.00

1.00

0.99

0.98

1.37

0.66

0.39

0.77

0.91

0.82

instruments.json

1.00

1.00

0.87

0.87

1.23

0.66

0.36

0.76

1.17

0.94

mesh.json

1.00

1.00

0.52

0.51

1.04

0.43

0.33

0.66

1.48

1.04

truenull.json

1.00

1.01

1.01

0.99

1.01

0.58

0.34

0.87

0.99

0.95

tweet.json

1.00

1.01

0.99

0.97

1.30

0.69

0.39

0.84

1.17

0.99

twitter.json

1.00

1.00

0.97

0.97

1.25

0.68

0.39

0.85

0.99

0.89

overall

1.00

1.01

0.91

0.87

1.54

0.80

0.53

0.82

1.19

0.94

ASCII vs UTF-8 Serialization

serialize

rj ascii[16]

rj utf8[17]

uj ascii[18]

uj utf8[19]

sj ascii[20]

sj utf8[21]

json ascii[22]

json utf8[23]

Long ASCII string

1.00

0.43

0.24

0.29

0.60

1.24

0.57

1.00

Long Unicode string

1.00

0.57

0.64

0.47

0.72

0.62

0.76

0.48

overall

1.00

0.53

0.51

0.41

0.68

0.82

0.70

0.65

DIY

To run these tests yourself, clone the repo and run:

to focus only on RapidJSON or:

to get full comparison against other engines.

To reproduce the tables above, run:

Compare different versions

pytest-benchmark implements an handy feature that allows you to weight the impact of a particular change. For example, you may start from a released version and execute:

$ make benchmarks PYTEST_OPTIONS=--benchmark-autosave

After applying whatever change to the code base, you can get a differential view by executing:

$ make benchmarks PYTEST_OPTIONS=--benchmark-compare=0001

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4