[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables
From: |
Stefan Monnier |
Subject: |
Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables. |
Date: |
Fri, 10 Feb 2017 01:07:00 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
> 1. For jump tables, HASH_TABLE_SIZE (h) == h->count, so using h->count
> directly saves the cost of an array lookup.
That doesn't invalidate the usefulness of a linear search.
> 2. Since the size equals the count, we don't need to check whether
> HASH_HASH (h, i) (the hash code) is non nil in every pass of the
> linear search loop (maphash needs to do this, before calling the
> providing function).
The linear search should compare HASH_HASH(h, i) to the search key's
hash anyway, so this comparison against nil is not needed.
Stefan
- defsubst VS defun or defmacro [was RE: Compiled code in Emacs-26 will fail in Emacs-25 if use pcase], (continued)
- 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, 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/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 <=
- 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
- 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/11
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Vibhav Pant, 2017/02/11
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Vibhav Pant, 2017/02/13
- Re: [PATCH]: Add new bytecode op `switch' for implementing branch tables., Vibhav Pant, 2017/02/09