Performance is slow due to huge number of documents being written to a list/document library
Microsoft has "Guidelines for acceptable performance" for SharePoint:
SharePoint Server 2010 capacity management: Software boundaries and limits
Very often the result of bad performance is related to exceeding SharePoint recommendations
If the performance degradation caused by SharePoint 2007 scalability limitations the solution would be to migrate the documents into different folders, each containing less than 2000 documents (for SharePoint 2007)