emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: String encoding in json.c


From: Eli Zaretskii
Subject: Re: String encoding in json.c
Date: Tue, 26 Dec 2017 06:35:29 +0200

> Cc: address@hidden, address@hidden
> From: Dmitry Gutov <address@hidden>
> Date: Mon, 25 Dec 2017 22:51:22 +0200
> 
> On 12/25/17 6:21 PM, Eli Zaretskii wrote:
> 
> > OK, but I presume the size of such buffers is rarely more than 1
> > MByte, say?
> 
> Maybe not. This bug report: 
> https://github.com/abingham/emacs-ycmd/issues/163 mentioned large 
> translation units, but I'm not sure which exact sizes are in play. The 
> reproduction scenario used a 300 KB example, encoding which was quite 
> slow at the time.

I'd expect the Jansson configuration to do that at least 10 to 20
times faster.

> > Files we visit are quite frequently much larger.  Which
> > is why I say that if the speed of en/decoding is crucial, we should
> > first and foremost work on speeding up file I/O.
> 
> If you mean I/O in general, maybe.

No, I meant file I/O specifically.  Our implementation of encoding and
decoding is separate for each one of: (a) file I/O, (b) process and
network I/O, (c) string encoding/decoding, (d) file-name encoding and
decoding (maybe I forget some).

> I'm not sure which encoding speeds json.c allows us now.

Well, Philipp measured it, so maybe he could share the benchmarks and
the results.

> But the JSON structure I was talking about is not written to a file. 
> It's sent over the network (usually to a local TCP socket).

In that case, encoding it is not a wasted effort, since it would have
been otherwise encoded when we send it.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]