static void main() throws IOException {
int rows = 100000;
int columns = 1;
String[][] data = new String[rows][columns];
for (int i = 0; i < rows; i++) {
for (int j = 0; j < columns; j++) {
data[i][j] = i + ";" + j;
}
}
SpreadSheet out = new SpreadSheet();
Sheet sheet = new Sheet("Sheet1", rows, columns);
out.appendSheet(sheet);
long startNano = System.nanoTime();
sheet.getDataRange().setValues(data);
double endNano = (double) (System.nanoTime() - startNano) / 1_000_000_000;
System.out.println("Time: " + endNano);
out.save(Path.of("testExport.ods").toFile());
}
Version
SODS 1.8.2
Problem
Range#setValue/setValuesis very slow.Range.setValues()takes around 22 sec withSheet#getIndexDeletebeing the hotspot with 94.6% time invested on it, and only 3.4% for saving the file.Expected