-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SVG backend has broken text fusion #111
Comments
I'd be happy to send a partial fix, but it appears https://github.com/diagrams/svg-builder is unmaintained, and I'd hate to go through the effort just for a patch to be ignored. |
Something really odd is going on here.
|
These days I can't give the time or attention to diagrams I would like, but it's definitely not unmaintained. A patch would be welcome and not ignored. I confess I don't know much about svg-builder or the SVG backend. They were originally written by @jeffreyrosenbluth but he probably doesn't remember either. In any case there's probably no hidden reason for the existence of Text --- probably just an oversight. |
Makes sense, thanks for the info. I'll try to put some more effort into this tomorrow. |
Indeed I don't remember the reason
|
I just started playing with diagrams again, and it's pretty great!
However, I'm running into speed issues. I have an example project here. This thing builds up maybe 900 circles, and does some transformations on them.
It takes about 9 seconds to run on my machine, even with
-O2
. This is too slow for any kind of live coding experience, so I decided to do some profiling. The results are here:and the cost centers:
Dang! Looks like text fusion is broken. The implementation of
toText
suggests why:formatRealFloat
returns aData.Text.Lazy.Builder
, but then the builder is immediately forced. Later, every other function in this module justText.concat
s them together! But all of these are strict texts! No wonder we're missing out on fusion and everything is allocating super hard!The fix as best I can tell is to make
toText
return aBuilder
, and then replace each instance ofT.concat
inGraphics.SVG.Path
withtoStrict . toLazy . mconcat
. Or better yet, to use this same builder all the way through the SVG generation.The text was updated successfully, but these errors were encountered: