0

I am using Raphael 2.01, Firefox 12.0, on Windows XP.

I've tried continuous object motion (not tween animation). I think the load by my script is light, but the sound of the PC's cooling fan will be loud!

I want to know the reason and solution.

(steps)

  • I set several circle objects (5 to 10) on the document.

  • They move on. When they touch the edge of the document, they return(move opposite direction), but their motion will slow down.

  • When I check the PC's load in Google Chrome's task manager, the memory usage becomes bigger and bigger (40MB ===> 150MB ===> ... )

(script)

http://jsfiddle.net/JsL46/3/

* Sorry. When I paste the code to the "jsfiddle", circle objects appear but they do not run.

Pshemo
  • 122,468
  • 25
  • 185
  • 269
Crane
  • 39
  • 1
  • 6
  • after messing about with the jsFiddle, it seems the memory leak is the least of your problems. debug, refactor and correct the script, than ask a more concise question. – Eliran Malka May 27 '12 at 19:08
  • Thank you Eliran, and sorry for my late reply. I think "translate()" consumes a lot memory, and it is better way to choice the function "animate()" to make memory consumption lower. But this method effects mathematical motion description of the lines very well. So I learn more about Raphael scheme. – Crane Jun 09 '12 at 12:15

1 Answers1

0

RaphaelJS does animation using traditional style changes and offsets, which causes alot and repaints and reflows. Use SVG SMIL animation to reduce the load on the browser for simple cases such as left/right movement.

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265