You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{-# LANGUAGE OverloadedStrings #-}
f::B.Builder
f ="a cat"<>"a dog"<>"a fish"
By using Builder from bytestring, the above code generates about 30 lines of core (compiler explorer), but we got 2200 lines when switching to text (compiler explorer)
This becomes a problem since I use katip for logging and it uses Builder from text internally. It's very common to use string literal to construct Builder while logging.
Possible root cause and solution
fromString has INLINE
This is the most obvious reason why it produce so many code. They are inlined three times and it seems that there's nothing (eg. RULE) to make them shorter.
But it's hard for me to tell if removing INLINE would make performance worse or not. (And I see no benchmark involve fromString)
Related issue
#19 (it's issue of pre 2.0 text which still use RULE to fuse though)