[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Elisp native-comp vs. SBCL for inclist-type-hints benchmark (was: [PATCH
From: |
Ihor Radchenko |
Subject: |
Elisp native-comp vs. SBCL for inclist-type-hints benchmark (was: [PATCH] Re: Bignum performance) |
Date: |
Sun, 03 Sep 2023 10:30:36 +0000 |
Emanuel Berg <incal@dataswamp.org> writes:
>> Unfortunately, I cannot use this file because it is referring to
>> ~/public_html/cl/bench/timing.cl, which I do not have.
>
> It is in the same directory
>
> https://dataswamp.org/~incal/cl/bench/timing.cl
It would be nice if you attached the files to email.
Otherwise, people examining this threads a few years in future may not
be able to access the files.
> So you have to set that manually as for now.
I did, and the results are very different from yours:
$ SBCL_HOME=/usr/lib64/sbcl sbcl --load /tmp/inclist.cl
;; 1.096667 s real time
;; 1.096235 s run time
$ SBCL_HOME=/usr/lib64/sbcl sbcl --load /tmp/inclist-type-hints.cl
;; 0.55 s real time
;; 0.549992 s run time
(emacs master)
$ perf record ./src/emacs -batch -l
/home/yantar92/.emacs.d/straight/repos/elisp-benchmarks/elisp-benchmarks.el
--eval '(setq elb-speed 2)' --eval '(elisp-benchmarks-run "inclist")'
* Results
| test | non-gc avg (s) | gc avg (s) | gcs avg | tot avg (s) |
tot avg err (s) |
|--------------------+----------------+------------+---------+-------------+-----------------|
| inclist | 1.20 | 0.00 | 0 | 1.20 |
0.02 |
| inclist-type-hints | 1.05 | 0.00 | 0 | 1.05 |
0.02 |
|--------------------+----------------+------------+---------+-------------+-----------------|
| total | 2.26 | 0.00 | 0 | 2.26 |
0.02 |
inclist: 1.1 sec vs. 1.2 sec
inclist-type-hints: 0.55 sec vs. 1.05 sec
with native-comp speed 3, the results are on par for inclist
$ perf record ./src/emacs -batch -l
/home/yantar92/.emacs.d/straight/repos/elisp-benchmarks/elisp-benchmarks.el
--eval '(setq elb-speed 3)' --eval '(elisp-benchmarks-run "inclist")'
* Results
| test | non-gc avg (s) | gc avg (s) | gcs avg | tot avg (s) |
tot avg err (s) |
|--------------------+----------------+------------+---------+-------------+-----------------|
| inclist | 1.07 | 0.00 | 0 | 1.07 |
0.02 |
| inclist-type-hints | 0.99 | 0.00 | 0 | 0.99 |
0.00 |
|--------------------+----------------+------------+---------+-------------+-----------------|
inclist: 1.1 sec vs. 1.07 sec
inclist-type-hints: 0.55 sec vs. 0.99 sec
There is nothing obvious that is slower in Elisp - most of the time is
spent in the native compiled functions:
47.83% emacs inclist-b6453dcf-34842bf7.eln [.]
F656c622d696e636c697374_elb_inclist_0
44.80% emacs inclist-type-hints-bb635d76-535ebfb0.eln [.]
F656c622d696e636c6973742d7468_elb_inclist_th_0
1.45% emacs emacs [.]
process_mark_stack
So, might be some missing optimization in native-comp itself.
CCing Andrea, in case if he has some insight about further analysis.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>