Skip to main content

UltraJSON

UltraJSON is an ultra fast JSON encoder and decoder written in pure C with bindings for Python 2.5+ and 3.

To install it just run Pip as usual:

$ pip install ujson

Usage

May be used as a drop in replacement for most other JSON parsers for Python:

>>> import ujson
>>> ujson.dumps([{"key": "value"}, 81, True])
'[{"key":"value"},81,true]'
>>> ujson.loads("""[{"key": "value"}, 81, true]""")
[{u'key': u'value'}, 81, True]

Benchmarks

UltraJSON calls/sec compared to three other popular JSON parsers with performance gain specified below each.

Test machine:

Linux version 2.6.32-131.0.15.el6.x86_64

Versions:

  • ujson: 1.21

  • simplejson: 2.6.2

  • cjson: 1.05

  • yajl: 0.3.5

  • Python: Python 2.6.6 (r266:84292, Jul 20 2011, 10:22:43)

ujson

simplejson

cjson

yajl

Array with 256 utf-8 strings

Encode

4090,74

899,39

83,86

3189,86

4,55

48,78

1,28

Decode

863,29

586,15

201,61

352,48

1,47

4,28

2,45

Medium complex object

Encode

9750,37

1377,15

1512,06

3341,91

7,08

6,45

2,92

Decode

5576,75

4247,16

3587,83

2850,13

1,31

1,55

1,96

Array with 256 strings

Encode

17998,01

12954,46

8715,02

15924,35

1,39

2,07

1,13

Decode

14540,71

19696,13

14908,46

9547,14

0,74

0,98

1,52

Array with 256 doubles

Encode

2185,20

1466,87

1956,99

3421,10

1,49

1,12

0,64

Decode

16062,01

8990,50

9743,40

8331,74

1,79

1,65

1,93

Array with 256 True values

Encode

69767,60

25202,56

41145,99

64330,76

2,77

1,70

1,08

Decode

91416,02

56439,97

54918,09

42786,02

1,62

1,66

2,14

Array with 256 dict{string, int} pairs

Encode

11307,54

1830,45

2720,90

7725,56

6,18

4,16

1,46

Decode

8695,94

7572,89

6076,71

5231,32

1,15

1,43

1,66

Dict with 256 arrays with 256 dict

Encode

37,76

4,88

10,49

27,62

7,74

3,60

1,37

Decode

17,70

15,56

11,25

12,00

1,14

1,57

1,47

Metadata

Release files for ujson 1.22

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ujson 1.22
File Size Uploaded
ujson-1.22.zip 193.7 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for ujson 1.22
File Interpreter ABI Platform
ujson-1.22.win32-py3.2.exe Details
ujson-1.22.win32-py2.7.exe Details
ujson-1.22.win32-py2.6.exe Details

Total release size: 849.2 kB

Release files / ujson-1.22.zip

Download URL ujson-1.22.zip
Size 193.7 kB
Tags Source
SHA-256 checksum
How to use checksums
459ae406944fbf4ff11b552d02f7b848c86401040fe1a4c8f488573232fbb6ff
BLAKE2b-256 checksum
How to use checksums
660ba553a74df3beb77ed045dd3c38a343550a26ac2476e0bb62e19a29548f94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / ujson-1.22.win32-py3.2.exe

Download URL ujson-1.22.win32-py3.2.exe
Size 218.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ec5d7a4bdf922ff2aecbc6929226503006dc624af39a020ba6e4f861f17485d7
BLAKE2b-256 checksum
How to use checksums
ccc04b74d6fdc4b7fb21d7525f4fae1e70db7358b1efca3cb8cb6d27879efb6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / ujson-1.22.win32-py2.7.exe

Download URL ujson-1.22.win32-py2.7.exe
Size 218.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9f2f6720706fd1947619a0f4d809c19badbd1af1f59a33717cd201d516acab6b
BLAKE2b-256 checksum
How to use checksums
1ee99614c0ec8b944e2146de3cab8b1d55452abceede78218eaeca489909e31d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / ujson-1.22.win32-py2.6.exe

Download URL ujson-1.22.win32-py2.6.exe
Size 218.7 kB
Tags Source
SHA-256 checksum
How to use checksums
265db804260033f6b49786863bb6701de6180c083de7121f0fe833297f05bdb6
BLAKE2b-256 checksum
How to use checksums
8a8f36e26f13a7477e6be5d9d63cabdad934efad4d8368da8f08dea38cbdb319
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

5.9.0

65 release files

5.8.0

61 release files

5.5.0

65 release files

5.3.0

50 release files

5.1.0

50 release files

5.0.0

50 release files

4.3.0

44 release files

4.2.0

44 release files

4.1.0

21 release files

4.0.2

21 release files

2.0.3

7 release files

2.0.2

7 release files

2.0.1

7 release files

2.0.0

1 release file

1.35

1 release file

1.34

2 release files

1.33

3 release files

1.30

4 release files

1.23

4 release files

This release

1.22 This release

4 release files

1.21

4 release files

1.19

3 release files

1.18

1 release file

1.15

1 release file

1.9

1 release file

1.8

1 release file

1.6

1 release file

1.4

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page