KineticJS icon indicating copy to clipboard operation
KineticJS copied to clipboard

Kinetic Super Laggy in FireFox when canvas is large.

Open lfmunoz4 opened this issue 13 years ago • 9 comments

When the canvas is large, width and height larger than 1000, and there are more than 1 shape in the layer, the dragging of basic shapes is super laggy. This makes Kinetic not usable in firefox with canvas larger than 1000x1000.

I'm using FireFox 19.0 and Kineticjs v4.3.3

Here is a demonstration of the the problem: http://www.lfmunoz.com/test/html5.html

Code is fully embedded in the link above.

What do you guys think?

lfmunoz4 avatar Mar 01 '13 22:03 lfmunoz4

the demo runs really smoothly for me in FF 19 on MacOS. What OS are you using?

Also, why are you using such a large canvas?

P.S., KineticJS will soon support clipping functions at container levels (such as layers and groups), and this can be used to optimize render performance. So if for some reason a particular rendering is slow, this would be one way to alleviate it.

ericdrowell avatar Mar 01 '13 23:03 ericdrowell

Thanks for looking into this. I am using debian linux but I also tried it on windows 8. It runs smoothly for me on chrome, but not firefox. I confirmed the laggyness on two different computers. I changed the canvas size to 2500x2500, you are telling me that still runs smooth using firefox? I think you must have 8 cores running at 3 Ghz, 12 Gig memory? Can you please confirm that you don't have a super computer, maybe try it on a virtual box with 4 gig mem constraint?

I am designing a diagram tool and some diagrams need a lot of space.

lfmunoz4 avatar Mar 02 '13 01:03 lfmunoz4

Were the other computers the same OS? I run a large canvas without speed issues on ff and chrome.

KorvinSzanto avatar Mar 02 '13 07:03 KorvinSzanto

I can confirm this. I am also working with stage sizes near fullscreen size and FF (regardless of version) performs very bad. Chrome works best, followed by IE9 (IE10 needs to be tested), Safari, Opera and then FF.

It does not matter if I test on Linux X86/X64 or Windows XP/7. FF lags on all platforms, Chrome does not. If I had to guess, then I'd say there is something wrong with hardware acceleration in FF.

hur0n avatar Mar 02 '13 12:03 hur0n

This may simply be the way that your application is written, can you reproduce this in a minimal jsfiddle?

KorvinSzanto avatar Mar 02 '13 18:03 KorvinSzanto

Can you get a video of this happening? I'm not sure I understand exactly what your issue is.

KorvinSzanto avatar Mar 06 '13 22:03 KorvinSzanto

First off, have you guys:

  1. created multiple layers, and grouped things together inside layers that are redrawn frequently, or together?
  2. reduced the amount of text and shadows for intense animations? (this is a canvas rendering constraint, not a KineticJS one)
  3. tried out node caching? caching greatly improves performance, because it essentially converts any piece of your drawing into an image.

The next release of KineticJS will now have clipping built into all containers so that you can define clipping paths around particular regions of interest on a layer to further tweak performance.

If you're seeing a problem exclusively with FF, there's a good chance it's just FF not performing well. I'll keep on eye on this.

ericdrowell avatar Mar 07 '13 06:03 ericdrowell

Disabling hardware acceleration in Firefox fixed the issue for me. Options > Advanced > "Use Hardware Acceleration When Available"

After doing this, Firefox performed just as well as Chrome. Kind of weird that this did the trick, though.

Verron avatar Aug 05 '13 06:08 Verron

The problem was with firefox browser, and currnly is solved. Issue is closed.

lavrton avatar Feb 27 '14 13:02 lavrton