The issue isn't related to the number of attributes on a single entity. It is related to the number of certain kinds of entities that will have attributes in a common context.
The details of why can get a bit involved, but I'll try... For the majority of simple entities (like Features, Sketches, etc...), attributes are attached directly to that owning entity, and performance should be in constant time and should not be an issue. But some more complex types there isn't a simple entity to hang these attributes on. These are called 'tracked' entities. Tracked entities require a more complicated referencing mechanism. The most common examples are references across a path of entities (such as an Occurrence or any assembly 'proxy' entity) , or a sub-entity (like BRep entities). An occurrence 'path' can be significantly altered in assembly restructure operations but still retain its 'identity'. Sub entities (particularly BRep entities) can be split, merged, etc... across updates but still have an identity to the user.
An example of the issue that has to be dealt with would be to consider entity tokens for these 'tracked entity' types. If you generate an entity token for a BRepFace (token1) and then add features that modify the face (split it, drill a hole in it, etc...) and generate a second token (token2): You will notice that token1 and token2 will not be identical. They have a different 'recipe' to resolve to the face to account for the changes at the different points in their change history. So you cannot just compare token1 to token2 to see if they would 'match their recipe' to the same face. You actually have to bind the token (run the recipe and generate the matches in the current state) and compare the matched results.
So in the case of Attributes on these tracked entity types (e.g. Occurrence), in order to be robust across model changes, resolving to the attributes set will involve an O(n) search for a matching tracked entity recipe of the same type and on the same 'source' entity. This isn't an issue issue as long as their is a sparse number of attribute sets created for the same tracked entity type on the same context (on the same source component). The worst case is adding attributes on a large number of tracked entities of the same type (e.g. Occurrence) in the same context (e.g. the same Occurrence.sourceComponent). And this sounds like what you are running into.
It's hard to recommend alternatives without a lot more understanding about what you need to achieve. But one option I mentioned would be to add a single Attribute on the source component with the application state you are trying to save. In some cases it might also be an option to invert things and add the Attributes to all of the target components instead.
Kris
Kris Kaplan