paperjs / paper.js

The Swiss Army Knife of Vector Graphics Scripting – Scriptographer ported to JavaScript and the browser, using HTML5 Canvas. Created by @lehni & @puckey
http://paperjs.org
Other
14.49k stars 1.23k forks source link

Lagging onMouseDrag Firefox #1033

Open MarkSchmidts opened 8 years ago

MarkSchmidts commented 8 years ago

I'm working on sound visualisation and try to visualize sound amplitudes in concentric circles using paperJs (paper-full v0.9.25) Each circle can be dragged and moved (rotated) Work's quite fine in chrome But I'm experiencing lagging when using firefox 45 on linux Sketch: http://goo.gl/3UcTWk

I can't see why it's not running fluently in FF, any ideas?

lehni commented 8 years ago

I guess the Canvas element on FF is just less optimized?

lehni commented 8 years ago

BTW: You don't need to run this on Sketch:

paper.install(window);
paper.setup('canvas');

Doing so will confuse the editor...

MarkSchmidts commented 8 years ago

I guess the Canvas element on FF is just less optimized?

So there's not much I can do about it?

Benchmarking the call frequency of onMouseDrag-method, I got expected results While dragging in FF the method gets called every 0.05s up to 4s In Chrome the method gets 0,04s up to 0.06s Any idea how we could stabelize onMouseDrag-method running on FF?

BTW: You don't need to run this on Sketch: ...

thanks, I didn't know yet

MarkSchmidts commented 8 years ago

Prepared a sketch with benchmark in console log after dragging http://goo.gl/FnwEG4

lehni commented 8 years ago

I get decent performance on Firefox / OSX... Trying Ubuntu next.

lehni commented 8 years ago

I can't reproduce this on Ubuntu / Firefox 45.0 either, and it's running in a VM in parallels so if anything, it should be even slower... Which version of Firefox are you experiencing this with? It may be something else on your computer, perhaps?

MarkSchmidts commented 8 years ago

I checked on other systems aswell and I'm guessing you're right. It might be slower but it's not to slow to act fluent. It's actually pretty much possible it's the canvas element not getting refreshed fast enough. Can you confirm the rotation is lagging in firefox?