Closed sbj42 closed 15 years ago
After some experimentation, I have found that the problem lies in the top-level vml group element that Raphael creates. IE tends to slow down when the group element contains large numbers of sub-elements.
I was able to improve speed greatly in simple test cases by removing the top-level group element entirely. So far I'm unable to patch Raphael to do this, because there's a lot of crazy group code in there that I don't understand.
sbj42 heres a cross reference to the issue. Maybe it ties in with your research? http://github.com/DmitryBaranovskiy/raphael/issues/closed/#issue/13
top level group has been removed. Didn’t notice any performance improvements. Not on this test anyway.
Raphael 0.8.6 resolves this issue for me. Running the test again, I get these results:
Browser | Time (ms) |
---|---|
Chrome 2.0.172.39 | 320 |
Firefox 3.5.2 | 185 |
IE 8.0.6001.18813 | 802 |
IE 6.0.2900.2180.xpsp_sp2_gdr.090206-1233 | 2,500 |
Note that the versions on most of those browsers are different from the original test, so this isn't a perfect re-test of the issue. I didn't mention it in my original post, but I think the Raphael version for the first test was 0.8.2.
Improved in 1.0. It will never be perfect, but I will close issue.
Using the following test code at http://raphaeljs.com/playground.html
Here are my results over several trials:
In other tests I have seen some improvement by creating the canvas in a new element that isn't in the DOM tree, and then moving the canvas into the DOM tree after the objects are created, but there are still big differences between the speeds.
Of course I'm sure it's impossible to get all browsers to perform identically, but I'm submitting this issue because I believe that the very high numbers for IE may be due to a bug in Raphael's VML processing. More research will be necessary to confirm this.