larcenists / larceny

Larceny Scheme implementation
Other
202 stars 32 forks source link

The macro expander needs to be tuned. #346

Open larceny-trac-import opened 10 years ago

larceny-trac-import commented 10 years ago

Reported by: lth on Mon Nov 22 06:00:00 1999 146 v0.47 (991122 / lth) Priority: medium Category: TWOBIT / quality-of-implementation

The macro expander needs to be tuned. The rest of Twobit needs to be tuned.

larceny-trac-import commented 10 years ago

Author: will The macro expander was spending a lot of time in the pattern matcher as it tried all of the rules for the .call macro in order. This was addressed by changeset:5209, which should be generalized. We should also investigate the importance of using a hashtable instead of an association list to represent syntactic environments.

Common subexpression elimination uses operations on sets of variables that are currently represented as lists of symbols. CSE therefore requires cubic time in the ''best case'', as a function of the number of variables that occur free or are bound by a lambda expression. There may also be problems with the efficiency of the hashtables and/or hashtrees used by CSE. For the short term, changeset:5231 just gives up on conversion to A-normal form and disables both CSE and representation inference.

Representation inference appears to be fast enough by itself, but uses CSE afterwards even if (common-subexpression-elimination) is false. Representation inference will therefore appear to be slow, but the real culprit is CSE.