Changeset 35652 in project


Ignore:
Timestamp:
06/21/18 11:15:29 (3 months ago)
Author:
kristianlm
Message:

eggref C4 cjson minor updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/cjson

    r35033 r35652  
    22[[toc:]]
    33[[http://call-cc.org/|Chicken Scheme]] bindings for the JSON parser [[https://github.com/DaveGamble/cJSON|cjson]]. It cannot read
    4 from ports and must have the entire JSON object in
    5 memory. {{chicken-cjson}} only parses JSON, does not serialize.
     4from ports and must have the entire JSON object in memory. It also
     5does not serialize to ports as {{cjson->string}} returns a string.
    66
    77The {{string->json}} procedure returns the same datastrucures as
     
    145145recommended to use [[http://wiki.call-cc.org/eggref/4/medea|medea]] or [[http://wiki.call-cc.org/eggref/4/json|json]] in most usage-cases because they
    146146can parse directly off ports and they also serialize. For particular
    147 cases, however, there may be significant performance improvements in
     147cases, however, there may be significant performace improvements in
    148148using [[https://github.com/DaveGamble/cJSON|cjson]].
    149149
     
    189189$ for f in test*.scm ; do echo ===== $f === ; cat $f ; done
    190190===== test-cjson.scm ===
    191 (use cjson ports)
     191(import cjson ports)
    192192
    193193(port-for-each
     
    199199
    200200===== test-medea.scm ===
    201 (use medea ports)
     201(import medea ports)
    202202
    203203(port-for-each
     
    225225
    226226In this particular run, {{chicken-cjson}} is 25 times faster than medea,
    227 and performs about as well as [[https://stedolan.github.io/jq/|jq]]. This speedup typically only
     227and performas about as well as [[https://stedolan.github.io/jq/|jq]]. This speedup typically only
    228228happens where you are parsing a lot of JSON, but only a small part of
    229229that needs to go back into scheme. Also, this only works because we
Note: See TracChangeset for help on using the changeset viewer.