Page MenuHomePhabricator

[YAML] Use {Specific}BumpPtrAllocators for HNodes.
Needs ReviewPublic

Authored by ributzka on Jul 26 2017, 11:42 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

The YAML parser already uses a BumpPtrAllocator for all its Nodes, but inside
YAMLTraits we still use make_unique for HNodes. This results in lot of malloc
traffic when parsing large or many YAML files.

Most HNode sub-classes can use a simple BumpPtrAllocator, but there are two
sub-classes that need SpecificBumpPtrAllocators to call the proper destructor.

Event Timeline

ributzka created this revision.Jul 26 2017, 11:42 AM
ributzka set the repository for this revision to rL LLVM.
ributzka added a subscriber: llvm-commits.
zturner added inline comments.
llvm/lib/Support/YAMLTraits.cpp
357

This is a little confusing. Why are you calling Allocate<ScalarNode>() but then actually constructing a ScalarHNode instead of a ScalarNode?

ributzka updated this revision to Diff 108499.Jul 27 2017, 10:30 AM

Updating D35908: [YAML] Use {Specific}BumpPtrAllocators for HNodes.

Fix a typo in the allocator argument. ScalarNode should have been ScalarHNode.

ributzka marked an inline comment as done.Jul 27 2017, 10:30 AM
ributzka added inline comments.
llvm/lib/Support/YAMLTraits.cpp
357

Oops, that is a typo. Thanks for catching this.