Fix #494 If a row is full, don't bother allocating a new one, just return it. Use the last populated row as a hint for the size of new rows. Simplify checkSheet to remove row mapformula
parent
6abf8bf972
commit
bf9a835549
@ -0,0 +1,27 @@
|
||||
package excelize
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func BenchmarkWrite(b *testing.B) {
|
||||
const s = "This is test data"
|
||||
for i := 0; i < b.N; i++ {
|
||||
f := NewFile()
|
||||
for row := 1; row <= 10000; row++ {
|
||||
for col := 1; col <= 20; col++ {
|
||||
val, err := CoordinatesToCellName(col, row)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
f.SetCellDefault("Sheet1", val, s)
|
||||
}
|
||||
}
|
||||
// Save xlsx file by the given path.
|
||||
err := f.SaveAs("./test.xlsx")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue