[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables
From: |
Clément Pit-Claudel |
Subject: |
Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables. |
Date: |
Thu, 9 Feb 2017 12:32:45 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 |
On 2017-02-08 08:38, Vibhav Pant wrote:
> On Tue, Feb 7, 2017 at 9:26 PM, Clément Pit-Claudel wrote:
>> The timings fluctuate quite a bit, but the byte-switch branch seems
>> to be about 5-7% slower. Hopefully linear-scan hash tables will
>> make things much faster :)
>
> The following patch makes hash_lookup use linear search when the
> number of keys in the hash table is <= 5 (chosen arbitrarily). switch
> bytecode run with this patch takes 15.96 seconds to run the
> benchmark, while the goto-if-nil code takes 17.15 seconds.
Thanks! Indeed, here are new timings:
$ rm -f *.elc; emacs-byte-switch -Q --batch --eval '(byte-compile-file
"eval-expr.el")'; time emacs-byte-switch -Q --batch -L . -l benchmark-expr.el
real 0m3.703s
user 0m3.664s
sys 0m0.012s
$ rm -f *.elc; emacs -Q --batch --eval '(byte-compile-file "eval-expr.el")';
time emacs -Q --batch -L . -l benchmark-expr.el
real 0m3.878s
user 0m3.860s
sys 0m0.016s
Things still fluctuate, but the byte-switch branch is now consistently faster,
by roughly 5% :)
Clément.
- RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase [was: Add new bytecode op `switch' for implementing branch tables.], (continued)
- RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase [was: Add new bytecode op `switch' for implementing branch tables.], Drew Adams, 2017/02/23
- RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase [was: Add new bytecode op `switch' for implementing branch tables.], T.V Raman, 2017/02/23
- RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase [was: Add new bytecode op `switch' for implementing branch tables.], Drew Adams, 2017/02/23
- RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase [was: Add new bytecode op `switch' for implementing branch tables.], T.V Raman, 2017/02/23
- RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase [was: Add new bytecode op `switch' for implementing branch tables.], Drew Adams, 2017/02/23
- defsubst VS defun or defmacro [was RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase], Tino Calancha, 2017/02/23
- Re: defsubst VS defun or defmacro [was RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase], Eric Abrahamsen, 2017/02/23
- Re: defsubst VS defun or defmacro [was RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase], raman, 2017/02/23
- Re: defsubst VS defun or defmacro [was RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase], Eric Abrahamsen, 2017/02/23
- Re: defsubst VS defun or defmacro [was RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase], raman, 2017/02/23
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables.,
Clément Pit-Claudel <=
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Clément Pit-Claudel, 2017/02/09
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Vibhav Pant, 2017/02/09
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Clément Pit-Claudel, 2017/02/09
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Vibhav Pant, 2017/02/10
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Stefan Monnier, 2017/02/10
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Vibhav Pant, 2017/02/10
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Stefan Monnier, 2017/02/10
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Vibhav Pant, 2017/02/10
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Vibhav Pant, 2017/02/10
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Paul Eggert, 2017/02/10