Whilst upgrading from 3.17 to 4.1.0 we experienced a severe reduction in the performance of writing a larger spreadsheet we have in our application. 3.17 took ~4 seconds 4.1.0 took 17-20 seconds (same for 4.0.0 and 4.0.1) After doing some digging it turned out XSSFRow.java onDocumentWrite method started using a lot more CPU time now. This eventually led to us looking at this patch r1825277 It looks like this performance optimisation was removed intentionally as part of bug #62130 Is there a way around this significant performance penalty? As it's likely to be deemed unacceptable for our users.
The previous optimisation appeared to cause problems in some cases. Feel free to submit a patch if you can get an implementation working that doesn't break the existing tests. Another option is to use SXSSFWorkbook for writing your file as this implementation doesn't have the XMLBean overhead (at the cost of reduced capabilities).
Thank you for your explanation, we're unlikely to find time to submit a patch soon but now we at least know what's up.