title: C# load xlsx file performance bad
body: <p>I have a question regarding Excel (Xlsx) files loading in C#. I have implemented Excel loading with NPOI 2.0 but the performance was quite bad (15 to 25 seconds loading time with 10000 rows and 60 columns (run on Win7 with a Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz (4 CPUs), ~2.5GHz)). I thought this was because NPOI 2.0 is still in beta, so I tried another library called EPPlus and it still takes about the same amount of time to load the Excel file.</p>
  
  <p>Here is how I load it with EPPlus: </p>
  
  <pre><code>var existingFile = new FileInfo(path);
  
  var excelData = new ExcelViewModel(path);
  
  // Open and read the XlSX file.
  using (var package = new ExcelPackage(existingFile))
  {
      // Get the work book in the file
      ExcelWorkbook workBook = package.Workbook;
      if (workBook != null)
      {
          // Here is some initializing......
  
          var viewSheetModel = new ExcelSheetViewModel(sheet.Name, numberOfColumns, titles);
          for (var row = titleRowIndex + 1; row &lt;= end.Row; ++row)
          {
              var viewRowModel = new ExcelRowViewModel();
  
              for (int column = start.Column; column &lt;= end.Column; ++column)
              {
                  var cell = sheet.Cells[row, column];
                  viewRowModel.AddCellValue(cell.Value != null ? cell.Value.ToString() : string.Empty);
              }
  
              viewSheetModel.Rows.Add(viewRowModel);
          }
  
          excelData.AddSheet(viewSheetModel);
      }
  }
  </code></pre>
  
  <p>According to the dotTrace Profiler about 40% of the time is wasted in the get_Workbook method (which is called by accessing the "package.Workbook" Property), and then another 30% in get_Item and get_Value calls and then 5% in the method AddCellValue (which is my data model) and the rest of the time is spread into various method calls.</p>
  
  <p>Is there something i'm doing wrong, or is this performance normal?</p>
  
  <p>Cheers</p>