I’m trying to write something with string parsing (something that may eventually turn into a JSON parser) with really good performance. I’m working something that needs to parse JSON-esque string literals like 800 million times. The current JSON library in Julia is fine for little things, but it’s not as fast as (for example) the Python’s JSON module. (just that everything else I’m using it for is faster in Julia)
At the moment, I’m kind of trying to write C in Julia: Turn off bounds checking, pre-allocate lots of buffers, deal with Base.CodeUnits instead of strings, use veiws for everything. I’m doing bit shifting. I’m doing all the things.
My current problem is that I’m trying to send a part of a string to parse
that I’ve already turned into CodeUnits, but I don’t want to pay for it being copied to a proper string.
Anyway, I know how to do it in C. char is just another number. There is no conflict. In Julia, I have to try really hard to work with buffers and raw arrays. Just let me send a $*^@#% pointer to some random point on an array to a string function!!
It seems that writing things in pure Julia is considered a virtue in the community. I kind of want to use Glib instead of parse
. I kind of want a lot of things. Is this normal? Should I just do it in C? I dunno. I just want to make something useful and reusable and as effing fast as possible.