cat / 012
clone

a spreadsheet for the terminal: lotus 1-2-3 looks, google sheets keys and formulas, one go binary

Size the lexer's token slice from the formula's length

Dami committed e5a0be8
Appending tokens through the lexer's field grew the slice as it filled,
which made deeply nested formulas lex slower than before the lexer was
split into methods. Starting with room for a token every two bytes
halves the allocations of parsing and brings BenchmarkNested/paren-10000
from 2.18 ms (1.93 ms before the split) to 1.78 ms.
commit
e5a0be842c52d33d3b22c4ad852a7cc764600106
parent
4cdc7667799e817d1715b49d5f738d9d3a29e6da
author
Dami <dami.etoile@gmail.com>
1 file changed, +3 -1
Minternal/formula/lex.go4+++-
M internal/formula/lex.go +3 -1