emacs-devel
[Top][All Lists]
Advanced

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

Re: On elisp running native


From: yyoncho
Subject: Re: On elisp running native
Date: Mon, 27 Apr 2020 07:41:46 +0300

I am glad that my report helped to improve native-comp branch.

Thanks,
Ivan

On Sun, Apr 26, 2020 at 3:00 PM Andrea Corallo <address@hidden> wrote:
yyoncho <address@hidden> writes:

> Hi,
>
> I did benchmarks of json parsing here it is what I get:
>
>   | test         | non-gc avg (s) | gc avg (s) | gcs avg | tot avg
> (s) | tot avg err (s) |
>   |
> --------------+----------------+------------+---------+-------------+-----------------
> |
>   | json-parsing |           2.57 |       3.32 |     318 |      
>  5.89 |            0.10 |
>   |
> --------------+----------------+------------+---------+-------------+-----------------
> |
>   | total        |           2.57 |       3.32 |     318 |      
>  5.89 |            0.10 |
>
>
> Native:
>
>   | test         | non-gc avg (s) | gc avg (s) | gcs avg | tot avg
> (s) | tot avg err (s) |
>   |
> --------------+----------------+------------+---------+-------------+-----------------
> |
>   | json-parsing |           1.71 |       4.31 |     343 |      
>  6.02 |            0.01 |
>   |
> --------------+----------------+------------+---------+-------------+-----------------
> |
>   | total        |           1.71 |       4.31 |     343 |      
>  6.02 |            0.01 |
>
> It looks like this is bellow the average speedup you might wanna take
> a look:
>
> Here it is the benchmark code:
>
> (require 'cl-lib)
> (require 'json)
>
> (defvar json-parsing-input (with-temp-buffer
>     (insert-file-contents-literally  "benchmarks/sample.json")
>     (buffer-string)))
>
>
> (defun elb-json-parsing-entry ()
>   (cl-loop repeat 1000
>   do (json-read-from-string json-parsing-input)))
>
> Thanks,
> Ivan

Hi Ivan,

I've got time to re-look into this.

The perf difference was due to GC time (as Eli pointed out all json
computation is in the C world).

I believe this delta was due to the greater number of objects allocated
in the native comp variant with the consequent more time needed to
traverse them during GC.

Since these measures I've made several changes to reduce the number of
unnecessary live objects.  Repeating the test on the current native-comp
against master I see on my machine a performance delta of 2% in favor of
master.  Considering I expect this effect to fade out on a real session
with more allocated objects I consider this being acceptable.

Andrea

--
address@hidden

reply via email to

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