I want to parse a String into an internal JSON object (or equivalent) in Java. The usual libraries, Gson and Jackson, are way too slow for my needs (> 100us for each String to Json parse, according to my benchmarks). I know there are slightly faster libraries, but looking at the benchmarks online, the gains available will be small (less than an order of magnitude improvement).
If I know the format of the JSON in advance, is there a way I can parse it much faster? For example, I know the String will be a JSON of the format:
{
"A" : 1.0 ,
"B" : "X"
}
i.e., I know the two keys will be "A" and "B", and the values will be a double and a string, respectively. Given this advanced knowledge of the format, is there a library or some approach to parse the JSON much faster than usual?
