Now back to the performance problems.
I'm consistently finding that code that calls read gets slower and slower until I call gc-flip, when it suddenly becomes faster again, but only for a while. Setting *parser-associate-positions?* to #f doesn't change this behavior, but that was my first guess.
Using the profiler shows what appears to be a hot spot in eqv?, with a lot of frames involving weak pairs. After a GC, that hot spot goes from 273 samples to 2. Stack sampler output attached.
Replacing the reader's make-shared-objects with a procedure that always returns the same hash table eliminates the problem. So it appears that the construction of the table is a bottleneck. Just calling make-strong-eqv-hash-table in a loop 1000 times isn't slow (80ms), so it does appear to increase GC pressure over time.
I'm not sure how to proceed. Suggestions welcome.
Thanks.