This is the mail archive of the
mailing list for the Guile project.
Memoization [was: `undefine']
- To: "Marisha Ray & Neil Jerram" <firstname.lastname@example.org>
- Subject: Memoization [was: `undefine']
- From: Greg Harvey <Greg.Harvey@thezone.net>
- Date: 15 May 1999 15:10:09 -0230
- Cc: "Mikael Djurfeldt" <email@example.com>, <firstname.lastname@example.org>
- References: <email@example.com>
"Marisha Ray & Neil Jerram" <firstname.lastname@example.org> writes:
> >A space finds a symbol's binding either by looking up the symbol in a
> >hash table (as for a local space), or by delegating the search to other
> >spaces. This means that the full symbol lookup process is too
> >expensive to perform on each variable reference. Thus, Guile uses
> >memoization and caching to avoid repeating the search for a given
> >variable's binding, unless the space's configuration has changed.
> I know I should really go and read the code, but I don't understand the
> benefit of memoization. Why is looking up a value in a GLOC so much quicker
> than looking it up in a value cell?
The GLOC is inserted in place of the original symbol, so the next time
through there's no need to do any environment lookups at all.