Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Canvas drawing performance optimization
Canvas drawing performance optimization [message #651630] Mon, 31 January 2011 23:36 Go to next message
Jean Bovet is currently offline Jean BovetFriend
Messages: 34
Registered: September 2009
Member
Hi,

I wanted to have some advice concerning performance optimization when
using the canvas to draw real-time graphs. My application displays
real-time graphs that are refreshed every second. Each refresh triggers
an http request from the server that is about 500KB in size. I noticed
that the UI could be more reactive when these graphs are being
refreshed (especially when more than one user is logged into the app -
note: the RCP application, while single user, doesn't have any
performance issue). So my first question is: does it make sense to
render these graphs as bitmap instead of using the canvas? The bitmap
itself might be smaller than the http request and might potentially
consume less CPU on the browser. Does anyone have any experience doing
such optimization? Is it worth considering it or is the canvas
implementation in RAP going to be improved soon (or is there something
else I can do in my code)?

Thanks,

Jean Bovet
Re: Canvas drawing performance optimization [message #652247 is a reply to message #651630] Thu, 03 February 2011 10:26 Go to previous message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 396
Registered: July 2009
Senior Member
Hello.

> real-time graphs that are refreshed every second. Each refresh triggers
> an http request from the server that is about 500KB in size. I noticed

That is an unusual size for a canvas graphic. Its indicating that it
simply is above the level of complexity that our canvas implementation
can handle at such a high refresh-rate. Whats the nature of your graph?
Could you give a screenshot?

> So my first question is: does it make sense to render these graphs as
> bitmap instead of using the canvas? The bitmap itself might be smaller
> than the http request and might potentially consume less CPU on the
> browser. Does anyone have any experience doing such optimization? Is it

I think we experimented with a similar concept once and found it was
very heavy on the server. In the browser it might be faster or slower,
that probably relies on too many variables to be sure.

> worth considering it or is the canvas implementation in RAP going to be
> improved soon (or is there something else I can do in my code)?

The canvas implementation in RAP will most likely not be essentially
changed anymore. We are investigating the possibility of implementing
Draw2D in a way that would be more efficient that drawing directly on
the canvas. However, this probabably wont happen very soon.

Regarding any optimizations to your code: Try reduzing the number of
drawing-operations, for example by leaving out decorative elements. Try
preventing drawing-operations that overlap each other. If you have a
static background, you could try setting it as a background-image on the
canvas instead of drawing it with GC.

Hope that Helps.

Greeetings,
Tim
Previous Topic:How to debug "Could not evaluate javascript response" message
Next Topic:Tree widget and horizonal scrollbar
Goto Forum:
  


Current Time: Thu Mar 28 11:20:25 GMT 2024

Powered by FUDForum. Page generated in 0.05224 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top