alex
alex copied to clipboard
Update words.x
trafficstars
A simple comment update to bring it up to date.
Additionally, I changed the function's return type from () to String as it's easier on the eye while executing the lexer.
If this is useful to anybody, here's a link to a sandbox repository I created for alex: https://github.com/PiotrJustyna/alex-sandbox
FYI: benchmark run:
time ./words.bin +RTS -s < /usr/share/dict/words
235976
1,749,384,800 bytes allocated in the heap
10,807,296 bytes copied during GC
62,848 bytes maximum residency (2 sample(s))
35,456 bytes maximum slop
6 MiB total memory in use (0 MiB lost due to fragmentation)
Tot time (elapsed) Avg pause Max pause
Gen 0 418 colls, 0 par 0.004s 0.004s 0.0000s 0.0001s
Gen 1 2 colls, 0 par 0.000s 0.001s 0.0006s 0.0012s
INIT time 0.004s ( 0.004s elapsed)
MUT time 0.204s ( 0.203s elapsed)
GC time 0.004s ( 0.005s elapsed)
EXIT time 0.000s ( 0.012s elapsed)
Total time 0.212s ( 0.224s elapsed)
%GC time 0.0% (0.0% elapsed)
Alloc rate 8,577,728,309 bytes per MUT second
Productivity 96.2% of total user, 90.7% of total elapsed
0.21s user 0.02s system 47% cpu 0.487 total
The benchmark run isn't affected noticeably by the changes in this PR.
Comment done. Feels like we could use a more general guide on how to get started with alex, but that's maybe for another day. Thanks for reviewing again.
Thanks, @PiotrJustyna for the contribution!