Skip to content

Instantly share code, notes, and snippets.

@eMaringolo
Created September 5, 2014 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eMaringolo/5e7c865188036faa7202 to your computer and use it in GitHub Desktop.
Save eMaringolo/5e7c865188036faa7202 to your computer and use it in GitHub Desktop.
"Compares the parse speed of three different JSON parsers."
{'file1.json'. 'file2.json'. 'file3.json' } do: [ :filename |
jsonString := fileName asFileReference contents.
Transcript cr; show: jsonString size printString, 'bytes JSON:'; cr.
Transcript show: 'NeoJSON: '; show: [ NeoJSONReader fromString: jsonString] bench; cr.
Transcript show: 'JSON: '; show: [Json readFrom: jsonString readStream ] bench; cr.
Transcript show: 'WAJsonParser: '; show: [WAJsonParser parse: jsonString] bench; cr.
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment