Home GnuPG
Diffusion GnuPG b85d509a8f5c

gpgscm: Optimize environment lookups and insertions.
b85d509a8f5cUnpublished

Unpublished Commit ยท Learn More

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

Description

gpgscm: Optimize environment lookups and insertions.

* tests/gpgscm/scheme.c (pointercmp): New function.
(new_slot_spec_in_env): Add and use slot for insertions.
(find_slot_spec_in_env): New variant of 'find_slot_in_env' that
returns the slot on failures.
(find_slot_in_env): Express using the new function.
(new_slot_in_env): Update callsite.
(opexe_0): Optimize lookup-or-insert.
(opexe_1): Likewise.
(scheme_define): Likewise.

Optimize environment lookups by keeping the lists in the hash table or
the list sorted. 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, 6:16 PM
Parents
rG874424ee3cc7: gpgscm: Fix build with list environments.
Branches
Unknown
Tags
Unknown

Event Timeline

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