Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
jxndnxu
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
3 ms
·
1.
▲
by
jxndnxu
2y ago
How would if have helped? You either design a DFA by hand or use a compiled from a regular language
2.
▲
by
jxndnxu
2y ago
You have answered your question yourself: your algorithm looks at each byte twice, not once It's even more obvious in the UTF case where the classic implementation first looks at 1-4 byte to parse a character and only then checks if it
3.
▲
by
jxndnxu
2y ago
My understanding of the article's use of scalable was "fixed overhead more or less regardless of the complexity of the state machine and input" not "fastest implementation available"
4.
▲
by
jxndnxu
2y ago
Because classic wc is not iterating over every byte once, but multiple times. It's especially obvious in the Unicode case where it first takes 1-4 bytes to get a Unicode character and then checks this character with another function to