Benchmark : String templating at runtime

Not a direct answer, but have you looked at using iolists for this? Here’s a nice article that touches on the performance benefits of iolists:
https://www.bignerdranch.com/blog/elixir-and-io-lists-part-1-building-output-efficiently/

The hard part would probably be parsing the “template” into something you can use to build an iolist. Also if you gave a few examples of the types of input you expect that would probably help people give you suggestions.

2 Likes