Optimizing GoAWK with a bytecode compiler and virtual machine

79 views
Skip to first unread message

ben...@gmail.com

unread,
Feb 3, 2022, 4:38:46 PM2/3/22
to golang-nuts
Recently I switched (so to speak) my GoAWK interpreter from using a tree-walking interpreter to a bytecode compiler with a virtual machine, and got a noticeable performance boost. Write-up here if you're interested: https://benhoyt.com/writings/goawk-compiler-vm/

TLDR: It's significantly more code, but also 10-20% faster. It'll get even faster when Go implements "switch" using jump tables (looking forward to https://go-review.googlesource.com/c/go/+/357330/).

-Ben

Kamil Ziemian

unread,
Feb 3, 2022, 5:17:51 PM2/3/22
to golang-nuts
I will try to follow development of GoAWK.
Reply all
Reply to author
Forward
0 new messages