Description
Hello! I am using ANTLR to parse https://github.com/gscept/GPULang which I've been using for years prior. Until recently I haven't bothered much with thinking about small optimizations, such as memory placement and being able to release the compilers resources in a swift way.
Recently I have been begun replacing the std::vector, std::strings and whatnot with my own containers that manage memory in a smarter way than doing tons of tiny mallocs.
When profiling I noticed that ANTLR does tons of tiny mallocs, and was wondering whether or not anyone considered approaching memory management in ANTLR with a smarter approach? I think it could be a great benefit to the performance, especially for the C++ target where manual memory management is possible.
Another thing that would be amazing would be to fail early if the input text isn't for example UTF8 and then allow for the user to request string_view's into the original text buffer instead of constructing tiny strings everywhere (which is also a malloc hazard). Not sure how plausible that is.
Thanks,
Gustav