dhatim / fastexcel

Generate and read big Excel files quickly
Other
684 stars 122 forks source link

CellAddress performance improvements. #100

Closed rzymek closed 4 years ago

rzymek commented 4 years ago

Memory usage test time went down from 1:38 to 1:24.

Microbenchmark results:

CellAddressBench.CellAddress1_parse   thrpt    6  4408.714 ± 530.906  ops/ms
CellAddressBench.CellAddress2_parse   thrpt    6  7683.455 ± 664.105  ops/ms

CellAddressBench.CellAddress1_format  thrpt    6  4539.635 ± 522.409  ops/ms
CellAddressBench.CellAddress2_format  thrpt    6  5056.850 ± 398.488  ops/ms
@Benchmark
public Object CellAddress1_parse() throws IllegalStateException {
    return new Object[]{
            new CellAddress("A1"),
            new CellAddress("XY1321"),
            new CellAddress("$XY1321"),
            new CellAddress("XFD1048576")
    };
}

@Benchmark
public Object CellAddress1_format() throws IllegalStateException {
    return new Object[]{
            new CellAddress(0, 0).toString(),
            new CellAddress(100, 100).toString(),
            new CellAddress(21333, 3213).toString(),
    };
}

Also adds support for A$1 format (absolute row).

ochedru commented 4 years ago

Great job. Thank you for your PR!