from Hacker News

Generic Freelist Allocator for Go

by Snawoot on 9/14/24, 8:14 PM with 3 comments

  • by nasretdinov on 9/15/24, 6:15 AM

    I've used this idea to speed up AST parsing: https://github.com/z7zmey/php-parser/issues/21

    By just reducing cost of doing allocations (but still allocating the same number of structs) on some of the hot paths it sped up making of the AST tree by 1.5x

    If you can use this approach for the entire parser I imagine the gains would be much more significant