GNU bug report logs -
#79361
minor jsonrpc optimisation suggestions
Previous Next
Full log
View this message in rfc822 format
> Cc: João Távora <joaotavora <at> gmail.com>
> From: Mattias Engdegård <mattias.engdegard <at> gmail.com>
> Date: Mon, 1 Sep 2025 20:58:50 +0200
>
> --- a/lisp/jsonrpc.el
> +++ b/lisp/jsonrpc.el
> @@ -548,11 +548,13 @@ initialize-instance
> (set-process-buffer proc (get-buffer-create (format " *%s output*" name)))
> (set-process-filter proc #'jsonrpc--process-filter)
> (set-process-sentinel proc #'jsonrpc--process-sentinel)
> + (set-process-coding-system proc 'binary 'binary)
Why not do this at make-process time?
> (with-current-buffer (process-buffer proc)
> (buffer-disable-undo)
> (set-marker (process-mark proc) (point-min))
> (let ((inhibit-read-only t))
> (erase-buffer))
> + (set-buffer-multibyte nil)
I would move this to make it the first thing we do in the buffer.
> + ;; `json-read' requires decoded input.
> + (json-read-from-string (decode-coding-string (buffer-string) 'utf-8)))))
Should be utf-8-unix, I believe, since JSON requires a literal \n as a
newline convention.
And yes, it would be nice to have timings.
This bug report was last modified today.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.