bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#31138: Native json slower than json.el


From: Eli Zaretskii
Subject: bug#31138: Native json slower than json.el
Date: Tue, 23 Apr 2019 16:19:04 +0300

> Cc: p.stephani2@gmail.com, sebastien@chapu.is, yyoncho@gmail.com,
>  31138@debbugs.gnu.org
> From: Dmitry Gutov <dgutov@yandex.ru>
> Date: Tue, 23 Apr 2019 14:39:50 +0300
> 
> On 23.04.2019 13:22, Eli Zaretskii wrote:
> 
> >>> Yes, but I'm slightly surprised why you loop from the end of the
> >>> string and not from the beginning.
> >>
> >> To avoid creating an additional pointer variable.
> > 
> > I don't think it matters, and looping forward is more natural and may
> > even be slightly faster.
> 
> OK. It was mostly a matter of taste for me anyway. (I would be 
> interested in any examples of "slightly faster", though).

It's a hunch.  I think modern processors and their caches deal with
incrementing better than with decrementing.  Maybe I'm wrong.

> significant up-front cost for initializing the decoder, right?

That, and the general disadvantage of going over the text twice
instead of just once.





reply via email to

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