-
Notifications
You must be signed in to change notification settings - Fork 85
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
chart-diagrams: Port to diagrams-1.3 #83
Conversation
This appears to work fine with the current state of the |
Actually, it seems like the colors are off in some of the EPS output (particularly tests 8, 9, 9c, 9l, and 9r). Is this a known issue with previous releases? |
Released the bug fix for |
See question on the related pull requests: #82 |
What's the news on this and on #82? |
I've merged this with master, in an attempt to use the newly unified test harness with it. The results are in https://github.com/timbod7/haskell-chart/tree/diagrams-1.3 unfortunately, the diagrams related modes of the harness all freeze, eg:
Have I done something silly? |
I could try to look into this. Can you give me instructions on how to build & run the test harness? |
The test harness can be built with The To see the problem you'll need to be on the diagrams-1.3 branch. |
} | ||
makeSvgFont font usedGs | ||
-- M.Map (String, FontSlant, FontWeight) (S.Set String) | ||
-- makeSvgFont :: (FontData, OutlineMap) -> Set.Set String -> S.Svg | ||
svg = D.renderDia DSVG.SVG (DSVG.SVGOptions (D2.Dims w h) fontDefs) d | ||
svg = D.renderDia DSVG.SVG (DSVG.SVGOptions (D2.dims2D w h) Nothing T.empty) d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened to the fontDefs
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahem, right, I needlessly dropped it. Good catch.
OK, thanks. Building now. I also took a careful look through all the diffs in this pull request and everything looks fairly straightforward. |
For me it does not hang, though it is rather slow (took several minutes to finish running |
If that is much slower than it used to be then perhaps we should look into why it is so slow. |
It does indeed seem to be much slower - i just assumed it had frozen! master:
diagrams-1.3:
|
Ouchies! That is comically bad. Let's see if we can figure out what is going on. Later today I will see if I can do some profiling. |
Sorry for the latency! My laptop has had an unfortunate incident involving a glass of tea and consequently internet access will be a bit spotty for a few days. As I recall things were indeed quite slow. |
It was easy to narrow the problem down to Call tree for the unmodified test suite (search for 99.9) Beyond that, I'm not sure what's changed. I don't see any changes to font handling in |
I can maybe fix this. My plan was to make SVGFonts depend on diagrams-input, because the svg parser in diagrams-input has a more correct path handling (d="M..") and is faster because of attoparsec and xml-conduit. Then half of the code in SVGFonts will vanish and maybe this bug will also go away. |
@tkvogt @bergey right, now this is coming back to me. I do remember tracing this back to I think |
Is it possible that the call to |
@bgamari Did you change xml-parsing or path parsing, or both in your branch? |
@tkvogt only path parsing as far as I can recall. |
For the record, I've rebased against |
As a data point here, I instrumented
Now I can see that |
Correction: |
I'm going to open an issue on the |
Could it be that simple: |
Yes, but |
Any outcome here? @tkvogt you'll find a pull request for the attoparsec rework above. |
I am in the middle of merging SVGFonts into the svg parser of diagrams-input, beacuse they logically belong together. But I don't want to let you wait for this. As mentioned here I will try a global lookup, test it and then upload SVGFonts to hackage. |
@timbod7 what do you think about just merging this? As far as I know the only issues are performance problems that can be dealt with later here or in SVGFonts. |
I want to see this in as much as anyone... However, It's 2 orders of magnitude slower than the existing diagrams backend, which is already significantly slower than the cairo backend. Even the tests don't finish in a reasonable amount of time. |
Fair enough. |
Not wanting to completely sideline the good work done on this so far, I spend a couple of hours tinkering this evening. There definitely seems to have been some performance regression in SVGFonts. This is exacerbated by the fact that one test harness inadvertently loads the fonts multiple times. I fixed that harness, and I've made a couple of API breaking changes to further reduce the impact of font loading:
These go some way to addressing the immediate problem, but I'm still unsure about what a pure API for font selection and text rendering should look like. Given the API change, the version will need to bump to 1.5 before a release. |
This ports the
diagrams
backend todiagrams-1.3
(as well as cleans up some style issues). I have yet to test with GHC 7.10 due to GHC bug #10288.