@@ -492,81 +492,83 @@ format, containing floats and arrays, indented.
492492
493493| Library | Median latency (milliseconds) | Operations per second | Relative (latency) |
494494| ------------| ---------------------------------| -------------------------| ----------------------|
495- | orjson | 0.75 | 1297 .5 | 1 |
496- | ujson | 2.06 | 483.5 | 2.74 |
497- | rapidjson | 2.12 | 470.7 | 2.82 |
498- | simplejson | 3.55 | 275.2 | 4.73 |
499- | json | 3.57 | 277.8 | 4.75 |
495+ | orjson | 0.74 | 1358 .5 | 1 |
496+ | ujson | 1.95 | 511.1 | 2.65 |
497+ | rapidjson | 2.58 | 387.1 | 3.51 |
498+ | simplejson | 3.49 | 287 | 4.74 |
499+ | json | 3.4 | 294.4 | 4.61 |
500500
501501#### twitter.json deserialization
502502
503503| Library | Median latency (milliseconds) | Operations per second | Relative (latency) |
504504| ------------| ---------------------------------| -------------------------| ----------------------|
505- | orjson | 3.29 | 302.3 | 1 |
506- | ujson | 3.65 | 281.2 | 1.11 |
507- | rapidjson | 5.6 | 179 .1 | 1.7 |
508- | simplejson | 5.19 | 188.3 | 1.58 |
509- | json | 5.62 | 184.2 | 1.71 |
505+ | orjson | 2.74 | 364.5 | 1 |
506+ | ujson | 3.01 | 332.7 | 1.1 |
507+ | rapidjson | 3.98 | 251 .1 | 1.45 |
508+ | simplejson | 3.64 | 275.5 | 1.33 |
509+ | json | 4.27 | 234.5 | 1.56 |
510510
511511#### github.json serialization
512512
513513| Library | Median latency (milliseconds) | Operations per second | Relative (latency) |
514514| ------------| ---------------------------------| -------------------------| ----------------------|
515- | orjson | 0.08 | 12363.5 | 1 |
516- | ujson | 0.2 | 4834.3 | 2.55 |
517- | rapidjson | 0.23 | 4385.4 | 2.84 |
518- | simplejson | 0.42 | 2360 .3 | 5.28 |
519- | json | 0.36 | 2709 .1 | 4.53 |
515+ | orjson | 0.08 | 12278.6 | 1 |
516+ | ujson | 0.19 | 5243.6 | 2.33 |
517+ | rapidjson | 0.29 | 3427.9 | 3.57 |
518+ | simplejson | 0.47 | 2125 .3 | 5.77 |
519+ | json | 0.36 | 2774 .1 | 4.4 |
520520
521521#### github.json deserialization
522522
523523| Library | Median latency (milliseconds) | Operations per second | Relative (latency) |
524524| ------------| ---------------------------------| -------------------------| ----------------------|
525- | orjson | 0.25 | 3992.4 | 1 |
526- | ujson | 0.32 | 3065.1 | 1.28 |
527- | rapidjson | 0.42 | 2400.2 | 1.68 |
528- | simplejson | 0.3 | 3293.5 | 1.21 |
529- | json | 0.38 | 2410 | 1.54 |
525+ | orjson | 0.23 | 4300.7 | 1 |
526+ | ujson | 0.29 | 3459.3 | 1.24 |
527+ | rapidjson | 0.33 | 2980.8 | 1.43 |
528+ | simplejson | 0.31 | 3186.4 | 1.36 |
529+ | json | 0.35 | 2892.5 | 1.5 |
530530
531531#### citm_catalog.json serialization
532532
533533| Library | Median latency (milliseconds) | Operations per second | Relative (latency) |
534534| ------------| ---------------------------------| -------------------------| ----------------------|
535- | orjson | 1.27 | 746.2 | 1 |
536- | ujson | 3.63 | 257.1 | 2.86 |
537- | rapidjson | 3.52 | 279 .8 | 2.77 |
538- | simplejson | 14.37 | 66.6 | 11.31 |
539- | json | 8.28 | 120.2 | 6.52 |
535+ | orjson | 1.21 | 835 | 1 |
536+ | ujson | 3.33 | 299.9 | 2.76 |
537+ | rapidjson | 3.8 | 264 .8 | 3.14 |
538+ | simplejson | 12.12 | 82.7 | 10.02 |
539+ | json | 7.81 | 129 | 6.46 |
540540
541541#### citm_catalog.json deserialization
542542
543543| Library | Median latency (milliseconds) | Operations per second | Relative (latency) |
544544| ------------| ---------------------------------| -------------------------| ----------------------|
545- | orjson | 5.61 | 175.8 | 1 |
546- | ujson | 6.78 | 146.8 | 1.21 |
547- | rapidjson | 7.71 | 129.4 | 1.37 |
548- | simplejson | 9.01 | 108.8 | 1.61 |
549- | json | 8.49 | 116.1 | 1.51 |
545+ | orjson | 5.25 | 190.5 | 1 |
546+ | ujson | 6.49 | 154.1 | 1.24 |
547+ | rapidjson | 8 | 124.9 | 1.52 |
548+ | simplejson | 7.94 | 125.7 | 1.51 |
549+ | json | 8.62 | 116.1 | 1.64 |
550550
551551#### canada.json serialization
552552
553553| Library | Median latency (milliseconds) | Operations per second | Relative (latency) |
554554| ------------| ---------------------------------| -------------------------| ----------------------|
555- | orjson | 5.28 | 189 .6 | 1 |
555+ | orjson | 5.54 | 180 .6 | 1 |
556556| ujson | | | |
557- | rapidjson | 69.38 | 14.3 | 13.14 |
558- | simplejson | 99.43 | 9.4 | 18.84 |
559- | json | 76.44 | 12.9 | 14.48 |
557+ | rapidjson | 70.29 | 14.4 | 12.69 |
558+ | simplejson | 90.03 | 11.2 | 16.25 |
559+ | json | 73.39 | 13.6 | 13.25 |
560560
561561#### canada.json deserialization
562562
563563| Library | Median latency (milliseconds) | Operations per second | Relative (latency) |
564564| ------------| ---------------------------------| -------------------------| ----------------------|
565- | orjson | 22.22 | 45.1 | 1 |
565+ | orjson | 19.6 | 51 | 1 |
566566| ujson | | | |
567- | rapidjson | 44.56 | 21.4 | 2.01 |
568- | simplejson | 42.99 | 23.2 | 1.93 |
569- | json | 44.69 | 21.4 | 2.01 |
567+ | rapidjson | 42.02 | 23.9 | 2.14 |
568+ | simplejson | 40.19 | 24.9 | 2.05 |
569+ | json | 41.5 | 24.1 | 2.12 |
570+
571+
570572
571573If a row is blank, the library did not serialize and deserialize the fixture without
572574modifying it, e.g., returning different values for floating point numbers.
@@ -584,46 +586,46 @@ calling `loads()` on the fixture.
584586
585587| Library | import, read() RSS (MiB) | loads() increase in RSS (MiB) |
586588| ------------| ----------------------------| ---------------------------------|
587- | orjson | 12.9 | 2.8 |
588- | ujson | 12.8 | 4.6 |
589- | rapidjson | 14.5 | 6.5 |
590- | simplejson | 13.1 | 2.7 |
591- | json | 12.5 | 2.4 |
589+ | orjson | 13.7 | 2.4 |
590+ | ujson | 13.4 | 4 |
591+ | rapidjson | 14.8 | 6.5 |
592+ | simplejson | 13.3 | 2.5 |
593+ | json | 12.8 | 2.6 |
592594
593595#### github.json
594596
595597| Library | import, read() RSS (MiB) | loads() increase in RSS (MiB) |
596598| ------------| ----------------------------| ---------------------------------|
597- | orjson | 12.3 | 0.3 |
598- | ujson | 12.6 | 0.5 |
599- | rapidjson | 13.9 | 0.4 |
599+ | orjson | 12.9 | 0.3 |
600+ | ujson | 12.5 | 0.4 |
601+ | rapidjson | 13.9 | 0.6 |
600602| simplejson | 12.5 | 0.3 |
601- | json | 11.7 | 0.3 |
603+ | json | 12.1 | 0.4 |
602604
603605#### citm_catalog.json
604606
605607| Library | import, read() RSS (MiB) | loads() increase in RSS (MiB) |
606608| ------------| ----------------------------| ---------------------------------|
607- | orjson | 13.7 | 8.5 |
608- | ujson | 13.9 | 12 |
609- | rapidjson | 15.4 | 30.2 |
610- | simplejson | 14.1 | 25 |
611- | json | 13.5 | 24.9 |
609+ | orjson | 14.6 | 7.7 |
610+ | ujson | 14.5 | 10.8 |
611+ | rapidjson | 15.7 | 26.1 |
612+ | simplejson | 14.3 | 16 |
613+ | json | 14.1 | 24.1 |
612614
613615#### canada.json
614616
615617| Library | import, read() RSS (MiB) | loads() increase in RSS (MiB) |
616618| ------------| ----------------------------| ---------------------------------|
617- | orjson | 16.5 | 17.5 |
619+ | orjson | 17.1 | 15.7 |
618620| ujson | | |
619- | rapidjson | 17.9 | 19.6 |
620- | simplejson | 16.6 | 21.3 |
621- | json | 16.0 | 21.3 |
621+ | rapidjson | 18.1 | 17.9 |
622+ | simplejson | 16.8 | 19.6 |
623+ | json | 16.5 | 19.5 |
622624
623625### Reproducing
624626
625- The above was measured using Python 3.7.4 on Linux with orjson 2.1.0 ,
626- ujson 1.35, python-rapidson 0.8.0 , and simplejson 3.16 .0.
627+ The above was measured using Python 3.8.1 on Linux with orjson 2.2.1 ,
628+ ujson 1.35, python-rapidson 0.9.1 , and simplejson 3.17 .0.
627629
628630The latency results can be reproduced using the ` pybench ` and ` graph `
629631scripts. The memory results can be reproduced using the ` pymem ` script.
0 commit comments