A
A
Aliceloves2014-04-16 12:16:45
JavaScript
Aliceloves, 2014-04-16 12:16:45

What are the ways to optimize rendering on HTML5 Canvas?

It is necessary to speed up the operation of the Canvas, on which some scheme is displayed in real time.
Problems in using "ordinary" optimization methods arise due to the fact that:

  • the scheme has no boundaries (offset)
  • suggests approaching / moving away (zoom)
  • draws up to several hundred primitives simultaneously (rectangle, image, text)
  • for everything else, it has a lot of lines connecting objects in the diagram, which makes it unclear how to use the "dirty rectangle".

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
silentvick, 2014-04-16
@silentvick

Maybe I will answer not quite the essence of the question, but I will suggest using a library specially created for such tasks: d3 . This will allow you to shift all optimization problems onto the shoulders of the library itself and concentrate on completing the original task.
There is everything you need: schema movement (no borders), zoom, events, optimized schema update when data changes, and more. Check out the demos.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question