emacs-devel
[Top][All Lists]
Advanced

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

Re: Type declarations in Elisp


From: Ihor Radchenko
Subject: Re: Type declarations in Elisp
Date: Mon, 28 Aug 2023 09:56:25 +0000

Andrea Corallo <acorallo@gnu.org> writes:

>> emacs -batch -l .../elisp-benchmarks.el -f elisp-benchmarks-run
>
> Mmmh but AFAIR elisp-benchmarks always native compiles at speed 3.

It is... a questionable default.

With speed 2, I get


| fibn               |           1.03 |       0.00 |       0 |        1.03 |    
        0.07 |
| fibn-named-let     |           1.71 |       0.00 |       0 |        1.71 |    
        0.08 |
| fibn-rec           |           3.71 |       0.00 |       0 |        3.71 |    
        0.13 |
| fibn-tc            |           4.44 |       0.00 |       0 |        4.44 |    
        0.04 |

Elisp bubble:         0.66 sec vs CBCL 0.66 sec
Elisp bubble-no-cons: 1.11 sec vs SBCL 0.81 sec
Elisp fibn:           1.03 sec vs. SBCL 0.07 sec
Elisp fibn-rec:       3.71 sec vs. SBCL 0.55 sec
Elisp fibn-tc:        4.44 sec vs. SBCL 0.41 sec

perf on all the fibn tests shows that recursion is still going through
`funcall' - most of the time is spent in Ffuncall, funcall_general, and
funcall_subr. Runtime typechecking (check_number_coerce_marker) is also
taking quite a bit of time.

arithcompare is strange. AFAIU, comparisons in the benchmarks are
(= n 0)/(= n 1). Why are they so costly?

    20.25%  emacs     emacs                                          [.] 
Ffuncall
    12.70%  emacs     emacs                                          [.] 
arith_driver
     9.59%  emacs     emacs                                          [.] 
funcall_general
     9.46%  emacs     emacs                                          [.] 
funcall_subr
     8.70%  emacs     emacs                                          [.] 
check_number_coerce_marker
     7.61%  emacs     emacs                                          [.] 
arithcompare
     6.63%  emacs     emacs                                          [.] 
arithcompare_driver
     6.17%  emacs     fibn-07298b84-44e7557d.eln                     [.] 
F656c622d6669626e2d7463_elb_fibn_tc_0
     5.95%  emacs     emacs                                          [.] Fplus
     4.09%  emacs     fibn-07298b84-44e7557d.eln                     [.] 
F656c622d6669626e2d726563_elb_fibn_rec_0
     1.98%  emacs     fibn-07298b84-44e7557d.eln                     [.] 
F656c622d6669626e_elb_fibn_0
     1.85%  emacs     emacs                                          [.] 
Feqlsign
     1.60%  emacs     fibn-07298b84-44e7557d.eln                     [.] 
F656c622d6669626e2d6e616d65642d6c6574_elb_fibn_named_let_0
     0.98%  emacs     emacs                                          [.] Flss
     0.64%  emacs     emacs                                          [.] Fminus

-- 
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>



reply via email to

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