Welcome to the CHICKEN Scheme pasting service

json parsing added by mario-goulart on Thu Sep 28 22:06:04 2017

$ cat json2.py 
import sys
import json

with open(sys.argv[1]) as fd:
    foo = json.load(fd)


$ cat ujson2.py 
import sys
import ujson

with open(sys.argv[1]) as fd:
    foo = ujson.load(fd)


$ cat json.scm 
(use medea)

(define foo
  (with-input-from-file (car (command-line-arguments)) read-string))


$ cat read-string.scm 
(use medea)

(define foo
  (with-input-from-file (car (command-line-arguments)) read-string))



$ time python2 json2.py 721.json 

real    0m0.046s
user    0m0.040s
sys     0m0.004s


$ time python2 ujson2.py 721.json 

real    0m0.038s
user    0m0.032s
sys     0m0.004s


$ time csi -s json.scm 721.json 

real    0m3.475s
user    0m3.388s
sys     0m0.084s


$ time csi -s read-string.scm 721.json 

real    0m0.038s
user    0m0.036s
sys     0m0.000s

$ du -b 721.json 
1750045 721.json

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Type in the text below:
           _ _   
 _ __  ___(_) |_ 
| '_ \|_  / | __|
| | | |/ /| | |_ 
|_| |_/___|_|\__|
                 
Visually impaired? Let me spell it for you (wav file) download WAV