-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Performance issues with c3js #2303
Comments
@conceptualspace I removed the Also, I opt-out a bunch of stuff when not used like subcharts (cogniteev@33b7a85), y2Axis (cogniteev@800164b) and others (d98423d) which save a massing amount of works. The thing is that I do not use the API at all to load data so I may have broken part of the API when data is loaded on the fly and add new axis. |
unfortunately i cant comment on what/if it breaks anything. that said i dropped your fork into one of my projects and instantly got 30% more boost. so i would endorse a PR 👍 |
@conceptualspace It's more certainly is, unfortunately there is a lack of tests which make it difficult to refactor with the certitude to not break anything. And I really can't spend time writing tests on features I do not use. |
i hear u.. |
I'm currently struggling with the poor performance of c3js as others do and there is a lot of reasons for that.
displaying a single line chart (from
simple.html
) callsgetBoundingClientRect
99 times which has a significant cost ( Generating 30+ charts on one page has bad performance #1645 )displaying a single line chart will also append and remove from DOM a dummy (to mesure font size) a dozen times per chart (probably because we call updateSizes N times per display)
it creates and resizes absolutely everything, although there is a single line chart it also create, append and resize the nodes for regions, arcs, titles, grid, the Y2 axis and the X axis for subchart (Too many elements in my SVG #1591)
each axis is created up to 5 times at render time, meaning for our line chart with 2 real axes we create in reality (with uncached sizing since it's a new instance etc.) 20 axes because we call updateScales/updateSizes multiple times at render time:
Basically the browser is taking all its time to modify dom, force relayout, mesure values, modify dom, force relayout, etc.. hundreds of times. (#1067)
There was attempt to cache values with
withoutCompute
for some parts but more often than not this is not used because the boolean is not passed.I started trying to opt-out from unused stuff (starting with axes) and I could reduce the 99 calls to
getBoundingClientRect
to 28 which feels much better on big dashboards but I'm not 100% familiar with the code stack so I can't be sure I'm not breaking some edge cases here and there.Is there anyone with some knowledge of the code stack that would be interested in trying to improve the performance? Is it worth it to try and do thing nicely and create PRs to this repository?
The text was updated successfully, but these errors were encountered: