about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@mozilla.com>2019-09-17 12:08:24 +1000
committerNicholas Nethercote <nnethercote@mozilla.com>2019-09-17 15:32:29 +1000
commit476e75ded71ad6f573daabe2ca7a1be9fe3ce3cb (patch)
tree94837a6293297f33ef727e4bd263bc4407504aca /src/libsyntax/parse
parent5670d048c0f88af9976b5505c7853b23dd06770d (diff)
downloadrust-476e75ded71ad6f573daabe2ca7a1be9fe3ce3cb.tar.gz
rust-476e75ded71ad6f573daabe2ca7a1be9fe3ce3cb.zip
Move a `Node`'s parent into the descendents list.
`Node` has an optional parent and a list of other descendents. Most of
the time the parent is treated the same as the other descendents --
error-handling is the exception -- and chaining them together for
iteration has a non-trivial cost.

This commit changes the representation. There is now a single list of
descendants, and a boolean flag that indicates if there is a parent (in
which case it is first descendent). This representation encodes the same
information, in a way that is less idiomatic but cheaper to iterate over
for the common case where the parent doesn't need special treatment.

As a result, some benchmark workloads are up to 2% faster.
Diffstat (limited to 'src/libsyntax/parse')
0 files changed, 0 insertions, 0 deletions