Coder Social home page Coder Social logo

gemmajson's Introduction

gemmaJSONlogo gemmaJSON - simdjson bindings for Nim

nimble install gemmaJSON

Benchmarks

Test was for deserialization of reddit comment json dumps, checking if the entry was from a specific subreddit

name ................. min time      avg time    std dv  times
sainttttt/gemmaJSON .. 13.291 s      13.386 s    ±0.110   x15
treeform/jsony ....... 28.280 s      28.659 s    ±0.366   x15
nim std/json ......... 72.095 s      73.678 s    ±1.436   x15

Usage

var jsonObj = parseGemmaJsonObj("""{"cat": {"a": ["woof", ["meow"], 2]}}""")

echo jsonObj.getStr("/cat/a/0")
# woof

echo jsonObj.getStr("/cat/a/1/0")
# meow

echo $jsonObj["cat"]["a"][0]
# woof

echo $jsonObj
# {"cat":{"a":["woof",["meow"],2]}}

var j = jsonObj.toJsonNode
echo j.pretty

# {
#   "cat": {
#     "a": [
#       "woof",
#       [
#         "meow"
#       ],
#       2
#     ]
#   }
# }

for e in jsonObj.getElement("/cat/a"):
  echo $e

# woof
# ["meow"]
# 2

gemmajson's People

Contributors

sainttttt avatar hmbemba avatar

Stargazers

Daniel Sokil avatar MA Jianjun avatar Phil Krylov avatar udit avatar starPt avatar Daniel Lemire avatar Antonis Geralis avatar Bung avatar Josh Miller avatar  avatar Willi Kappler avatar  avatar

Watchers

Daniel Lemire avatar  avatar

Forkers

hmbemba s0kil

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.