Quick and dirty json benchmark pasted by sjamaan on Thu Apr 27 15:53:53 2017

(use medea utils cjson)

(print "medea from port:")
(time (with-input-from-file "guildwars.json" read-json))

(print "medea from string:")
(time (with-input-from-file "guildwars.json" (lambda () (read-json (read-all)))))

(print "cjson from string:")
(time (with-input-from-file "guildwars.json" (lambda () (string->json (read-all)))))

medea from buffered port: added by DerGuteMoritz on Thu Apr 27 16:44:22 2017

(time (call-with-input-file "guildwars.json"
        (lambda (in)
          (let ((bin (make-buffered-input-port in 4096)))
            (read-json bin)))))

;;; Results Using http://demosthenes.org/tmp/111 as input
;; 2.286s CPU time, 0.806s GC time (major), 2829690/63337 mutations (total/tracked), 30/14657 GCs (major/minor), maximum live heap: 127.27 MiB
;; medea from string:
;; 0.456s CPU time, 1061009/12716 mutations (total/tracked), 0/5400 GCs (major/minor), maximum live heap: 4.07 MiB
;; medea from buffered port:
;; 0.455s CPU time, 1067878/14470 mutations (total/tracked), 0/5401 GCs (major/minor), maximum live heap: 4.1 MiB
;; cjson from string:
;; 0.048s CPU time, 0.002s GC time (major), 128453/14477 mutations (total/tracked), 1/292 GCs (major/minor), maximum live heap: 4.04 MiB