[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATH] Use hash table instead of flat list for lam
Re: [Chicken-hackers] [PATH] Use hash table instead of flat list for lambda literals
Mon, 27 Feb 2012 10:06:51 +0100 (CET)
> The change is pretty simple; prepare-for-code-generation walks the node
> tree, assembles a list of all lambda literals and returns it, which
> generate-code then consumes to generate a list of all lambdas.
> In two places it uses an internal FIND-LAMBDA helper procedure, which
> loops through the list and tries to find a lambda literal that has
> the same ID as a reference to it in a call site.
> Instead of looping through the entire list, it could just use a hash
> table, which requires us to modify prepare-for-code-generation to
> create one. The hash table size is initialized to the analysis database
> size, perhaps this could be tweaked further to save on memory usage
> as this is most likely way too much since there are usually more
> "normal" variables than lambdas. For example, the numbers test has
> 14051 lambdas, and the program size is about 10 times as big.
Signed off and pushed.
Re: [Chicken-hackers] [PATH] Use hash table instead of flat list for lambda literals,