Iwark / spreadsheet

Google Go (golang) library for reading and writing spreadsheet files on Google Docs.
MIT License
382 stars 53 forks source link

Faster cell update #45

Closed 2qar closed 5 years ago

2qar commented 5 years ago

Closes #41 Update appends cells as needed now instead of using newCells() and copy()

Old:

BenchmarkUpdate1-4           3000000           436 ns/op         392 B/op          8 allocs/op
BenchmarkUpdate10-4           100000         18974 ns/op       36120 B/op        165 allocs/op
BenchmarkUpdate100-4             100      10644594 ns/op    23758243 B/op      10608 allocs/op
BenchmarkUpdate1000-4              1    12064988411 ns/op   22628726584 B/op     1006038 allocs/op

New:

BenchmarkUpdate1-4               5000000               302 ns/op             168 B/op          6 allocs/op
BenchmarkUpdate10-4               200000              9607 ns/op           17752 B/op         79 allocs/op
BenchmarkUpdate100-4                2000            745441 ns/op         1698392 B/op        714 allocs/op
BenchmarkUpdate1000-4                 20          68877041 ns/op        157273052 B/op      6791 allocs/op
Iwark commented 5 years ago

Nice! Thank you :)