Speedup of functions to en/decode UTF-8 text

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Speedup of functions to en/decode UTF-8 text

Eli Zaretskii
I've made some changes in the functions that encode and decode UTF-8
text in an optimized fashion.  This is expected to speed up JSON
handling.  Some preliminary benchmarking of the decoding function
indicates speed improvements starting at modest 30-40%, and sometimes
much higher -- tenfold or more.  I'm not sure how this will fare in
the real-life handling of JSON objects, so I'd welcome speed
measurements of the current master branch as compared to previous
versions (yesterday and older) in real-life scenarios, in particular
in LSP and Eglot.  Please report the results here, and if there are
some significantly adverse effects of these changes, please report
them as bugs.

TIA

Reply | Threaded
Open this post in threaded view
|

Re: Speedup of functions to en/decode UTF-8 text

João Távora
I work on multiple branches, and I don't always wish to rebase them
on top of master.  Can you say exactly what commit SHA's your
changes consists of, presuming I can cherry-pick them to those
branches?

Thanks,
João



On Sat, Nov 23, 2019 at 9:38 AM Eli Zaretskii <[hidden email]> wrote:

>
> I've made some changes in the functions that encode and decode UTF-8
> text in an optimized fashion.  This is expected to speed up JSON
> handling.  Some preliminary benchmarking of the decoding function
> indicates speed improvements starting at modest 30-40%, and sometimes
> much higher -- tenfold or more.  I'm not sure how this will fare in
> the real-life handling of JSON objects, so I'd welcome speed
> measurements of the current master branch as compared to previous
> versions (yesterday and older) in real-life scenarios, in particular
> in LSP and Eglot.  Please report the results here, and if there are
> some significantly adverse effects of these changes, please report
> them as bugs.
>
> TIA



--
João Távora

Reply | Threaded
Open this post in threaded view
|

Re: Speedup of functions to en/decode UTF-8 text

Eli Zaretskii
> From: João Távora <[hidden email]>
> Date: Sat, 23 Nov 2019 10:43:08 +0000
> Cc: Ivan Yonchovski <[hidden email]>, emacs-devel <[hidden email]>
>
> I work on multiple branches, and I don't always wish to rebase them
> on top of master.  Can you say exactly what commit SHA's your
> changes consists of, presuming I can cherry-pick them to those
> branches?

It's commit c26556b on master.  (It might look scary at first sight,
but most of it is changes in commentary.)

Thanks.

Reply | Threaded
Open this post in threaded view
|

Re: Speedup of functions to en/decode UTF-8 text

Stefan Monnier
In reply to this post by Eli Zaretskii
> handling.  Some preliminary benchmarking of the decoding function
> indicates speed improvements starting at modest 30-40%, and sometimes
> much higher -- tenfold or more.

Cool!


        Stefan


Reply | Threaded
Open this post in threaded view
|

Re: Speedup of functions to en/decode UTF-8 text

Dmitry Gutov
In reply to this post by Eli Zaretskii
On 23.11.2019 11:37, Eli Zaretskii wrote:
> I've made some changes in the functions that encode and decode UTF-8
> text in an optimized fashion.  This is expected to speed up JSON
> handling.  Some preliminary benchmarking of the decoding function
> indicates speed improvements starting at modest 30-40%, and sometimes
> much higher -- tenfold or more.  I'm not sure how this will fare in
> the real-life handling of JSON objects

This is great. But were those 30-40% improvements in tests with strings
or JSON decoding?

I tested two old examples, and the difference is <10% (like 0.78s down
to 0.73s in the best case). Which is still welcome, of course.

Reply | Threaded
Open this post in threaded view
|

Re: Speedup of functions to en/decode UTF-8 text

Eli Zaretskii
> Cc: [hidden email]
> From: Dmitry Gutov <[hidden email]>
> Date: Sat, 23 Nov 2019 20:42:09 +0200
>
> On 23.11.2019 11:37, Eli Zaretskii wrote:
> > I've made some changes in the functions that encode and decode UTF-8
> > text in an optimized fashion.  This is expected to speed up JSON
> > handling.  Some preliminary benchmarking of the decoding function
> > indicates speed improvements starting at modest 30-40%, and sometimes
> > much higher -- tenfold or more.  I'm not sure how this will fare in
> > the real-life handling of JSON objects
>
> This is great. But were those 30-40% improvements in tests with strings
> or JSON decoding?

With JSON decoding.  But I have a very small sample of that.

> I tested two old examples, and the difference is <10% (like 0.78s down
> to 0.73s in the best case). Which is still welcome, of course.

As long as it's faster, I'm okay ;-)

Thanks for testing.

Reply | Threaded
Open this post in threaded view
|

Re: Speedup of functions to en/decode UTF-8 text

Eli Zaretskii
In reply to this post by Eli Zaretskii
> From: yyoncho <[hidden email]>
> Date: Sun, 24 Nov 2019 18:44:28 +0200
>
> Hi Eli,
>
> Thank you for the heads up.
>
> I run the lsp-mode benchmark test and I observed ~30% speedup of JSON parsing.

OK, thanks for letting us know.