Monthly Archives: November 2021

json-shootout Rust/simd-json

I just merged Erik’s implementation of json-shootout in Rust, using the simd-json crate. Here’s a table of the results of the benchmarks implemented so far: Language/Library Parse Time Memory Used Access Time python 0.6771s 135940kB 0.0346s C/cJSON 0.2322s 149548kB 550.2047s … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

sxe-jitson-to-json and sxe-factory

I just added two new modules to libsxe: sxe-factory and sxe-jitson-to-json. sxe-factory is a generic object that allows an arbitrary binary sequence to be constructed in dynamically grown memory allocated from the heap. It’s used by sxe-jitson-to-json to build a … Continue reading

Posted in c programming | Tagged , , , | Leave a comment

What Programming Languages are Worth Learning?

I just took a look at the Tiobe Index, which ranks programming language popularity based on Stack Overflow, Github, and other sources. How things have changed since 2017, when I wrote Go is in the Top 10, According to Tiobe. Here … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment

Benchmark of golang’s JSON Parser

I just implemented the json-shootout benchmark in golang, using the builtin JSON parser. The code is here: https://github.com/jimbelton/json-shootout/blob/master/json-golang.go Here are the results: jim@noatun:~/Source/json-shootout$ go run json-golang.goLoaded dictionary in 0.611037248s, size 126112kBLooked up all keys in dictionary in 0.01396387 Here are … Continue reading

Posted in golang programming | Tagged , , | Leave a comment

Installing golang on Linux

Installing golang on linux is easy: Go to the golang downloads page and download the latest linux tarball: https://golang.org/dl/ Run: sudo tar -xzf -C /usr/local -f ~/Downloads/go1.17.3.linux-amd64.tar.gz Edit ~/.profile and add a line: PATH=$PATH:/usr/local/go/bin Just this once, source the file: … Continue reading

Posted in golang programming | Tagged , | Leave a comment

XX3 64 Bit Hash is Very Fast

Using lookup3, the sxe-jitson benchmark is much quicker: Loaded dictionary in 0.111029s, size 47346kBFirst access in 0.009391s, size 47813kBLooked up all keys in dictionary in 0.034964s Switching the hashing algorithm to XXH32 makes sxe-jitson even faster: Loaded dictionary in 0.118541s, … Continue reading

Posted in c programming | Tagged , , , | Leave a comment

sxe-jitson: Just In Time Indexing

I began this hack because I wanted a JSON parser that was fast and memory efficient, and yet allowed the parsed objects it produced to be accessed very quickly. One of the things I’ve noticed about systems that use JSON … Continue reading

Posted in c programming | Tagged , , | Leave a comment

sxe-jitson: A Minor Update

At the suggestion of Vinnie Parla, I switched from duplicating the stack after parsing JSON to reallocing the parsed JSON to size and returning it. This improved the speed that sxe-jitson is able to parse. The latest code is at: … Continue reading

Posted in c programming | Tagged , , , | Leave a comment

First Benchmarks for sxe-jitson

I just update json-shootout to benchmark sxe-jitson. You can find it here: https://github.com/jimbelton/json-shootout. To build the sxe-jitson benchmark, you need to download sxe and build sxe/libsxe (with make release), and the sxe and json-shootout directories must be in the same … Continue reading

Posted in c programming | Tagged , , , | Leave a comment

sxe-jitson Accessor Functions

I just added functions for getting the size of a parsed JSON string (number of characters), array (number of elements), or object (number of members). As well, I’ve added functions to get a member of an object by name and … Continue reading

Posted in c programming | Tagged , , | Leave a comment