This project has moved. For the latest updates, please go here.

Performance difference between two computers (C#)

Oct 12, 2015 at 11:55 AM
I have an issue with exporting a datatable to a worksheet. there is an enormous difference between two different computers, and the weirdest thing is that the slow computer is much (much) stronger than the other.
var wsDt = pck.Workbook.Worksheets.Add(sheetName);
                wsDt.Cells["A1"].LoadFromDataTable(sheetData, true);

                for (int i = 0; i < sheetData.Columns.Count; i++)
                {

                    if (sheetData.Columns[i].DataType == typeof(DateTime))
                        wsDt.Cells[2, i + 1, sheetData.Rows.Count + 1, i + 2].Style.Numberformat.Format = "mm-dd-yy";
                    else if (sheetData.Columns[i].DataType == typeof(decimal))
                        if (sheetData.Columns[i].ColumnName.ToLower().Contains("pct") ||
                            sheetData.Columns[i].ColumnName.ToLower().Contains("profit") ||
                            sheetData.Columns[i].ColumnName.ToLower().Contains("chg"))
                            wsDt.Cells[2, i + 1, sheetData.Rows.Count + 1, i + 1].Style.Numberformat.Format = "0.00%";
                        else wsDt.Cells[2, i + 1, sheetData.Rows.Count + 1, i + 1].Style.Numberformat.Format = "#,###.00";

                }
The data table is big (~150,00 rows * 102 columns)
On my computer (win7 - 64 bit, i5) the 'fill sheet' part takes 19 seconds and the formatting part 3m15s
On my server (win server 2012 - 64 bit, E5-2667) it took about 7 minutes to fill the sheet and the formatting part is still running as we speak, it finished 31 columns over the last 35 minutes.

On my computer I have office 2013, on the server there is office 2010, if it makes any difference.

Any thoughts?