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

Slow generation of hyperlinks

Jul 14, 2015 at 4:26 AM
Edited Jul 14, 2015 at 4:29 AM
Hi;
Currently trying to generate a medium size spreadsheet - trace file showing timestamps.

2015-07-14 15:42:02,829 DEBUG DataflowQueue.Core.Excel.BaseExcelGeneratorEPPlus - BaseGenerator Writing 408 Column Headers
2015-07-14 15:42:02,860 DEBUG DataflowQueue.Core.Excel.BaseExcelGeneratorEPPlus - BaseGenerator Start writing 5000 Data Rows
2015-07-14 15:42:03,063 DEBUG DataflowQueue.Core.Excel.BaseExcelGeneratorEPPlus - BaseGenerator Start writing 784471 cells
2015-07-14 15:42:05,657 DEBUG DataflowQueue.Core.Excel.BaseExcelGeneratorEPPlus - BaseGenerator Start writing 65550 hyperlinks
2015-07-14 15:45:02,069 DEBUG DataflowQueue.Core.Excel.BaseExcelGeneratorEPPlus - BaseGenerator End Generate

Question is:
Writing 784471 cells takes 2 seconds.
Writing 65550 hyperlinks takes just under three minutes.
            Log.Debug(string.Format("BaseGenerator Start writing {0} cells", cells.Count));
            foreach (var cell in cells)
                {
            WriteCell(cell);
                }  
   
            Log.Debug(string.Format("BaseGenerator Start writing {0} hyperlinks", hyperlinks.Count));
            foreach (var hyperlink in hyperlinks)
                {
            WriteHyperLink(hyperlink);
                }

            protected void WriteCell(Cell cell)
                {
                WriteCell(cell.RowIndex + 1, cell.ColumnIndex + 1, cell.Value);
                }

           protected IXLCell WriteCell(int row, int column, string cellData)
                {
                return Worksheet.Cell(row, column, cellData); //extension method
                }

           protected void WriteHyperLink(Cell hyperlink)
               {
               WriteCell(hyperlink.RowIndex + 1, hyperlink.ColumnIndex + 1, hyperlink.Value).Hyperlink.ExternalAddress =   new Uri(hyperlink.Value);
               }
Is there something I've missed with regards to generating hyperlinks- or is there an optimised way to create hyperlinks?

Thanks
Kern