It tooks 4-5 minutes for 3K columns. public class Excel2007ColumnSize extends TestCase { int TOTAL_COL = 3000; short WDITH = 15 * 255; public void testSetColumnSize() { Workbook wb = new XSSFWorkbook(); Sheet st = wb.createSheet(); Row row = st.createRow(0); System.out.println("1: " + System.currentTimeMillis()); for (int i = 0; i < TOTAL_COL; i++) { st.setColumnWidth(i, WDITH); } System.out.println("2: " + System.currentTimeMillis()); } }
Any chance you could use a profiler to work out where the time goes within that ColumnHelper method?
Created attachment 31656 [details] profiler run time poi_runtime.xml
Comment on attachment 31656 [details] profiler run time I am not performance expert, I tried to use netbeans profiler and got the report attached , most time is spend on org.apache.xmlbeans.impl.store.Locale.count(org.apache.xmlbeans.impl.store.Xobj, javax.xml.namespace.QName, org.apache.xmlbeans.QNameSet) org.apache.xmlbeans.impl.store.Xobj.find_element_user(javax.xml.namespace.QName, int)
Created attachment 31657 [details] call stack
I've made a change in r1600319, which I think should help. Any chance you could do a build from svn / get a nightly build after that, and see if it has made it better?
Thanks a lot, it is much better now,the time drops to 2 seconds from 4-5 minutes using the same test case.