c233270a9b
Previously we were allocating a separate heap object for each token, which creates a lot of small objects for the GC to manage. Since we know that we're always converting from a flat array of native tokens, we can produce a flat array of writer tokens first and _then_ take pointers into that array to achieve our goal of making a slice of pointers. For the use-case of formatting a sequence of tokens by tweaking the "SpacesBefore" value, this means we can get all of our memory allocation done in a single chunk and then just tweak the allocated, contiguous tokens in-place, which should reduce memory pressure for a task which will likely be done frequently by a text editor integration doing "format on save".
Description
fork of https://github.com/hashicorp/hcl
because issue :
https://github.com/hashicorp/hcl/issues/290
these code permit use of "nested" field decoding which is just composite struct
Languages
Go
83.7%
Ragel
10.2%
reStructuredText
4.4%
Ruby
0.5%
Python
0.3%
Other
0.8%