Thank you for this awesome library, we love it 😄
We've noticed that when we add custom tags (of which we've added 8) it slows down our compiles tremendously when processing those tags. So just the tags take about 20 seconds to compile.
Do you know if this is this something that's just a limitation of nimble_parsec and some kind of Big(O) issue with the underlying algorithms or potentially how we're constructing our tags that's resulting in way more parser combinations than needed?
Here's an example of a custom tag:
In Liquid it is:
{% image file_id %}
The elixir:
@impl true
def spec(_parser) do
space = Literal.whitespace(min: 0)
ignore(BaseTag.opening_tag())
|> ignore(space)
|> ignore(string("image"))
|> ignore(space)
|> tag(Argument.argument(), :file_id)
|> ignore(space)
|> ignore(BaseTag.closing_tag())
end
Yeah the parser is quite complex and to keep it fast we avoid using lots of "defcombinators". But it's something we can revisit once we have a proper set of benchmarks :thinking:.
Thank you for this awesome library, we love it 😄
We've noticed that when we add custom tags (of which we've added 8) it slows down our compiles tremendously when processing those tags. So just the tags take about 20 seconds to compile.
Do you know if this is this something that's just a limitation of
nimble_parsec
and some kind of Big(O) issue with the underlying algorithms or potentially how we're constructing our tags that's resulting in way more parser combinations than needed?Here's an example of a custom tag:
In Liquid it is:
The elixir: