[racket] why does in-indexed / in-range slow down my program?

From: Limbo Peng (iwinux at gmail.com)
Date: Sun Jan 20 22:22:30 EST 2013


Hi Danny,

On 01/20, Danny Yoo wrote:
> Oh!  I'm sorry.  I didn't even look at that part of Peng's email, and
> missed the comment on a faster algorithm.  I had no idea what
> "quick-find" or "quick-union" were.

"quick-find" is a naive implementation of the union-find algorithm, which is presented in the book Algorithms (4th edition) written by Robert Sedgewick.

Slow by its nature, it seems to be slowed down further by the usage of "for" and "in-indexed" - and neither Racket Guide nor Racket Reference mention the ineffiencies of this part.

BTW: how can I see the expanded form of the "for" macro?


Posted on the users mailing list.