Currently the parser returns types based on the lifetime of the pre-parsed text. This allows for better possible performance along with possibly reducing memory consumption (I think). On the other hand though it makes parsing more complicated, and dealing with the loosely typed representation more complicated.
I think it's worth switching to owned types just to make things simpler and more ergonomic. If I was going for absolute best speed, then it would be nice to use references, but there are already other choices (like pest) where ergonomics has been picked over raw speed
An experimental switch to owned types resulted in a ~40% regression in parsing time so I'm going to currently leave the library as is due to the large performance difference.
Currently the parser returns types based on the lifetime of the pre-parsed text. This allows for better possible performance along with possibly reducing memory consumption (I think). On the other hand though it makes parsing more complicated, and dealing with the loosely typed representation more complicated.
I think it's worth switching to owned types just to make things simpler and more ergonomic. If I was going for absolute best speed, then it would be nice to use references, but there are already other choices (like
pest
) where ergonomics has been picked over raw speed