[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Evolution & optimization of the module system

From: Ludovic Courtès
Subject: Re: Evolution & optimization of the module system
Date: Mon, 09 Apr 2007 01:06:46 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)


Kevin Ryde <address@hidden> writes:

> One possibility for duplicates would be lazy checking, only check for
> a clash when actually using a symbol.  That's sort of the prolog
> theory: don't worry now about what might never come up.  I suspect the
> total work would end up greater though.

Attached is a patch that implements lazy duplicate checking.  Thus,
`process-duplicates' is gone and `module-variable' plays its role when a
variable is looked up for the first time.  Subsequent lookups result in
a "cache hit", i.e., the result is taken from the "import obarray" which
is used as a cache.

The code is simpler and obviously less memory-hungry than my previous
attempts.  The lazy approach is not very R6RS-friendly, though (see my
earlier post on this topic).

I measured around 20% speedups in "pure startup time".  The measurements
consist in running a dozen of times a program that just does a few
`use-module's and/or `autoload's and measuring the total user execution
time.  Example scripts are available there:

These measurements do not account for the overhead introduced in the
variable lookup process, so measurements with actual programs were

reply via email to

[Prev in Thread] Current Thread [Next in Thread]