title: A POI related code block running dead slow
body: <p>I have below piece of code block containing loops:</p>
  
  <pre><code>Row row = null;
  Cell cell = null;
  String dataVal = null;
  String[] temp = null;
  
  for (int j = 0; j &lt; this.myDataValues.size(); j++) {
    row = sheet.createRow(rownum++);
    temp = this.finalRowValues.get(j);
  
     for (int i = 0; i &lt; 4; i++) {
         cell = row.createCell(i);
  
         dataVal = temp[i];
  
              if (NumberUtils.isNumber(dataVal)) {
                  double d = Double.valueOf(dataVal);
                  cell.setCellValue(d);
                  cell.setCellType(Cell.CELL_TYPE_NUMERIC);
                  cell.setCellStyle(styles.get("currency"));
              } else if (isValidDate(dataVal)) {
                  cell.setCellValue(dataVal);
                  cell.setCellType(Cell.CELL_TYPE_NUMERIC);
                  cell.setCellStyle(styles.get("date"));
              } else {
                  cell.setCellValue(temp[i]);
                  cell.setCellType(Cell.CELL_TYPE_STRING);
                  cell.setCellStyle(styles.get("data"));
              }
              sheet.autoSizeColumn(i);
          }
      }
  </code></pre>
  
  <p>Where <code>myDataValues</code> is a <code>List</code> of <code>String[]</code> with each <code>String[]</code> object containing 4 values.</p>
  
  <p>I am running this in Rational Application Developer version 8 and Apache POI 3.8. </p>
  
  <p>There are around 5500 elements in <code>myDataValues</code> which is a pretty small value I believe. </p>
  
  <p>However, this code block is taking more then a hour to run. </p>
  
  <p>I think there is something wrong with this. 5500 elements with each containing 4 elements should run pretty fast and should be a question of several minutes. What could be the possible cause? Is there a way to make this block run faster?</p>
  
  <p>There is nothing wrong with available memory of the machine or any other such issues. Everything is working as expected and I have verified it. The issue is in this block only. </p>