# fields and decls: ArrayList appending, memcpy to ast arena · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/64c149ca19cc299485693acbda325eee51d37f28)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 64c149ca19cc299485693acbda325eee51d37f28

Requested commit: 64c149ca19cc299485693acbda325eee51d37f28

Commit: 64c149ca19cc299485693acbda325eee51d37f28

Tree: 4722fb13d235122b1e69d78bc19a868c7c52609a

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
fields and decls: ArrayList appending, memcpy to ast arena

This makes fields and decl ast nodes part of the Root and ContainerDecl
AST nodes.

Surprisingly, it's a performance regression from using a singly-linked
list for these nodes:

throughput: 76.5 MiB/s => 69.4 MiB/s

However it has much better memory usage:

maxrss: 392 KB => 77 KB

It's also better API for consumers of the parser, since it is a flat
list in memory.

```

## Parents

- [b1bcdc96ca4451be95caa00fe71aafb578611e34](https://git.cafe/gitcafe/zig/commit/b1bcdc96ca4451be95caa00fe71aafb578611e34?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/64c149ca19cc299485693acbda325eee51d37f28?format=markdown)
