[plt-scheme] Unexpected slowdown using memoized function

From: Grant Rettke (grettke at acm.org)
Date: Sun Aug 12 11:44:43 EDT 2007

On 8/12/07, Jos Koot <jos.koot at telefonica.net> wrote:
> The prime? predicate of math.ss precomputes and memoizes the primeness of all
> natural numbers <= 1000000.

I see.

> Adding an extra layer of memoization necessarily slows down, assuming you dont
> often ask for the primeness of numbers greater than 1000000, which seems
> unlikely because you investigate the primeness of bitcounts.

Exactly.

Thanks Jos.


Posted on the users mailing list.