The following two patches greatly speed up the process of loading join tables used for HABTM relationships, which do not have model classes associated with them.
The original behavior failed in this regard in two ways.
First off, the model_class method of the Fixtures class, which is used over and over again during the fixture loading process, is written to look up the class associated with the fixture file and cache it so that the method can be called cheaply. Unfortunately, it relied on a ||= mechanism that caused the look up to be retried for fixtures without model classes.
Another performance suck was in Fixture.new. Although the model class is calculated in the Fixtures class, only the class name was passed down to the individual Fixture class, and then the model class was re-determined. This is unnecessary if the model class is passed down to the Fixture class instead of the class name.
I was able to cut the test suite running time for the project that exposed these issues from 128 seconds to 47 seconds, using these two fixes.
One thing to note about the second change is that it changes the API for Fixture.new. As a result, plugins that rely on the old API for Fixture.new will no longer work. We could add some protection so that Fixture.new will accept either a model_class or class_name.. in fact, the current Fixture.new shows signs that it did this very thing. I chose not to do this for simplicity's sake.