table.setColumnWidth() is extremely slow


I am having performance problems using Table.setColumnWidth() method.

Our customer have Presentations with about 20 slides each. Each slide has a table of 50 rows and 7 to 9 columns. Here is the timing for a single table with 50 rows and 9 columns:

elapsed time: 45.616 seconds
memory usage: 4472kb

Just for testing I tried a table with 100 rows and 9 columns, here is the results:

elapsed time: 287.193 seconds
memory usage: 8159kb

Is there anything you can do to improve the performance of setColumnWidth method. Waiting more than 10 minutes to create 20 slides is too slow.
Note: using the default column width does not degrade performance - the 9x50 table takes 2.413 seconds only.

Here the test code with 50 rows and 9 columns:

        Slide slide = templatePres.getSlideByPosition(1);
        Shapes shapes = slide.getShapes();
        Table t = shapes.addTable(10, 576, 10*576, 8*576, 9, 50);
        for(int i=0; i<50;i++)
           t.setrowheight(i, 96);
        for(int i=0 i<9; i++)
           t.setcolumnwidth(i, 576);


Hi Alexey,

do you have any comments about this issue? Thanks a lot.


I’ve made some optimizations in .Net version. Your example works 3-4 seconds.
I’m testing these changes now. If everything will be ok I will do the same for Java.


Great job! I just tried Aspose.Slides for Java, and creating the 50x9 table now takes 1.612 seconds. Thanks a lot.