emacs-devel
[Top][All Lists]
Advanced

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

Re: On elisp running native


From: Andrea Corallo
Subject: Re: On elisp running native
Date: Sun, 26 Apr 2020 12:00:46 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

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]