This is the mail archive of the
guile@cygnus.com
mailing list for the Guile project.
Memoization [was: `undefine']
- To: "Marisha Ray & Neil Jerram" <mpriz@dircon.co.uk>
- Subject: Memoization [was: `undefine']
- From: Greg Harvey <Greg.Harvey@thezone.net>
- Date: 15 May 1999 15:10:09 -0230
- Cc: "Mikael Djurfeldt" <mdj@nada.kth.se>, <guile@cygnus.com>
- References: <007d01be9da2$d33e70a0$263870c2@mpriz.dircon.co.uk>
"Marisha Ray & Neil Jerram" <mpriz@dircon.co.uk> 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.
--
Greg