[racket-dev] Large preferences file and performance

From: Casey Klein (clklein at eecs.northwestern.edu)
Date: Thu Dec 2 20:20:08 EST 2010

I just pushed a fix for a bug that made DrRacket extremely sluggish on
my laptop. Most everything was slow, but typing in the find and
replace fields was particularly bad -- each character would take about
a second to appear on screen.

The problem turned out to be that my framework preferences file was
enormous, a problem since DrRacket saves your preferences very
frequently. In particular, it saved them on each keystroke in the find
and replace fields. (But no more. See http://bit.ly/eQmhOH)

My preferences file was enormous because, due to a bug, it had
accumulated more than three years of REPL history. I no longer have
the ballooned file, but IIRC, it was tens of thousands of expressions,
totaling a few MB of text.

To help spot issues like this one, Robby and I have added a little "P"
indicator near the GC icon that turns on when the preferences file is
being saved. If the P flashes rapidly (as it would have when you typed
in the find or replace fields) or stays on for a while (as it would
have if your preferences file were large), it may indicate a
performance problem. The P won't appear at all unless you're running a
nightly build or building from git.


Posted on the dev mailing list.