f0cii
f0cii
MModular
Created by eggsquad on 10/16/2024 in #community-showcase
EmberJson: High level JSON library
Hey! I also created an open-source project for JSON handling in Mojo: sonic-mojo. It seems to be ~7.5 faster than the parser you mentioned(https://github.com/bgreni/EmberJson)! This project is based on Mojo FFI bindings for sonic-rs and uses Diplomat for code generation, with some modifications in my forked version f0cii/diplomat. Here are my benchmark results:
--------------------------------------------------------------------------------
Benchmark results
--------------------------------------------------------------------------------
name , met (ms) , iters , min (ms) , mean (ms) , max (ms) , duration (ms)
JsonParseSmall , 0.001463, 803360, 0.001463, 0.001463, 0.001463, 1175.402216
JsonArrayMedium , 0.003468, 359714, 0.003468, 0.003468, 0.003468, 1247.467734
JsonArrayLarge , 0.005713, 204953, 0.005713, 0.005713, 0.005713, 1170.873361
JsonArrayExtraLarge , 0.625991, 1848, 0.625991, 0.625991, 0.625991, 1156.831185
JsonArrayCanada , 4.995497, 248, 4.995497, 4.995497, 4.995497, 1238.883308
JsonArrayTwitter , 0.973425, 1000, 0.973425, 0.973425, 0.973425, 973.424817
JsonArrayCitmCatalog , 2.057586, 545, 2.057586, 2.057586, 2.057586, 1121.384578
--------------------------------------------------------------------------------
Benchmark results
--------------------------------------------------------------------------------
name , met (ms) , iters , min (ms) , mean (ms) , max (ms) , duration (ms)
JsonParseSmall , 0.001463, 803360, 0.001463, 0.001463, 0.001463, 1175.402216
JsonArrayMedium , 0.003468, 359714, 0.003468, 0.003468, 0.003468, 1247.467734
JsonArrayLarge , 0.005713, 204953, 0.005713, 0.005713, 0.005713, 1170.873361
JsonArrayExtraLarge , 0.625991, 1848, 0.625991, 0.625991, 0.625991, 1156.831185
JsonArrayCanada , 4.995497, 248, 4.995497, 4.995497, 4.995497, 1238.883308
JsonArrayTwitter , 0.973425, 1000, 0.973425, 0.973425, 0.973425, 973.424817
JsonArrayCitmCatalog , 2.057586, 545, 2.057586, 2.057586, 2.057586, 1121.384578
https://github.com/f0cii/sonic-mojo
38 replies