openworm / org.geppetto.frontend

Geppetto Java frontend bundle
http://www.geppetto.org/
Other
29 stars 25 forks source link

Plots (Flot Charts library) consuming too much CPU #43

Closed jrmartin closed 10 years ago

jrmartin commented 10 years ago

Drawing too many points in a Plot widget uses too much CPU power.

According to this post, http://stackoverflow.com/questions/13471454/display-huge-amount-of-data-with-jquery-flot, it's advised to limit the amount of points drawn to be of the same ratio as the Flot Charts canvas. I.E. If Plot widget is 400px, a maximum of 400 points should be drawn, one per pixel.

Issue seems to happen only when data to be plotted is received by the server, generating random number within the client seems to have worked before regardless if the points to be drawn exceeded the width of widget.

tarelli commented 10 years ago

Does the issue happen also when the server is not the development machine, i.e. when we are using the live instance?

jrmartin commented 10 years ago

Yeah, it does. This examples does real time updates http://www.flotcharts.org/flot/examples/realtime/index.html, it could be modified and use to test this bug by adding more points to draw (doing 300 points at 818 px).

tarelli commented 10 years ago

@jrmartin this looks like a nice alternative, what do you think?

tarelli commented 10 years ago

@jrmartin this is also something interesting to look at as a way to reduce the number of points displayed.

jrmartin commented 10 years ago

I took a look at the NVD3 library, and it seems to have more features that flot charts API. There's also options to redraw the axis on real time without it being too slow as show in http://bost.ocks.org/mike/path/ example at the bottom of the page.

tarelli commented 10 years ago

Really nice...

borismarin commented 10 years ago

+1

On 16 March 2014 15:42, Matteo Cantarelli notifications@github.com wrote:

Really nice...

Reply to this email directly or view it on GitHubhttps://github.com/openworm/org.geppetto.frontend/issues/43#issuecomment-37760335 .

pierre-pretorius commented 10 years ago

The flot CPU issue has been resolved: http://www.flotcharts.org/blog/2014/04/21/flot-083-released/

mlolson commented 10 years ago

Yes... my strategy of doing nothing for weeks has once again been vindicated. :muscle:

tarelli commented 10 years ago

@pierre-pretorius thanks for letting us know! I incorporated the new version. @jrmartin It seems faster to met but I don't know if I'm under placebo, can you also test it when you get a chance?

pierre-pretorius commented 10 years ago

We have an application where we render about 50+ graphs on one page. The new flot version took CPU usage from chrome making your pc unusable (in windows) to CPU staying idle.