Subject: json parsing error position reform

From: Mattias Engdegård <[email-masked]>
Date: Thu, 7 Aug 2025 17:19:48 +0200

The json parser (src/json.c) spends a surprising amount of time keeping track of the current line and column, on the off chance that an error occurs in which case that information would helpfully be included. This is a bad design in a variety of ways:

(1) It goes against all performance engineering to spend resources on maintaining information that is unlikely to be used.
(2) JSON parse errors aren't expected to occur during normal operation.
(3) From what I can tell, nobody uses the position information of the json-error signal at all.
(4) One reason for (3) is that it isn't documented anywhere.
(5) Even if someone would find the position useful, there is no evidence that they would need the line and column (which could easily be derived from the position).

So let's remove at least the line and column of the error position. We can still supply the position from the start of the parse because we have the information anyway.

There's a patch. Surprisingly, it speeds up the parsing part by more than 10 % which is definitely worthwhile.