Eli Zaretskii writes: >> So basically I'd say the problem is in gnulib's compareseq. If it >> can't be fixed there, I see no other possibility than to stop using >> replace-buffer/region-contents in json.el (and wherever it might also >> be used). That would be sad because except for the performance in >> some cases, it's very nice. :-( > > Could we decide whether to use replace-* functions dynamically, based > on the size of the region/buffer being prettified? No, the size is just a secondary measure here. I've successfully and quickly prettified much larger JSON files. I've just tried with some other sample json file which is about three times the size of the file in this report. That also triggered an early_abort of compareseq but within MAX-SECS time. And here I have almost half a million compareseq_early_abort tests, not just 321. I've now modified it to approximately the same size as the file of ljell (the reporter). Then it doesn't trigger early_abort, is fast, and slightly below 300.000 early_abort tests are performed.