Home GnuPG
Diffusion GnuPG cea6d114b60d

gpgscm: Optimize symbol lookups and insertions.
cea6d114b60dUnpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

gpgscm: Optimize symbol lookups and insertions.

* tests/gpgscm/scheme.c (oblist_find_by_name): Keep the list of
symbols sorted, return the slot where a new symbol must be inserted on
lookup failures.
(oblist_add_by_name): Add the new symbol at the given slot.
(mk_symbol): Adjust callsite.
(gensym): Likewise.
(assign_syntax): Likewise.

Optimize symbol lookups by keeping the lists in the hash table (or the
list if compiled with USE_OBJECT_LIST) sorted by the symbol names.
Optimize the insertions by passing the slot computed by the lookup to
the insertion.

  • Signed-off-by: Justus Winter <justus@g10code.com>

Details

Provenance
justusAuthored on Jan 31 2017, 1:22 PM
Parents
rG8f0ecb16cbb3: gpgscm: Fix build with object list.
Branches
Unknown
Tags
Unknown

Event Timeline

Justus Winter <justus@g10code.com> committed rGcea6d114b60d: gpgscm: Optimize symbol lookups and insertions. (authored by Justus Winter <justus@g10code.com>).Jan 31 2017, 6:49 PM