onWireMouseMove performance

10 views
Skip to first unread message

John Osborne

unread,
Mar 9, 2012, 3:30:02 AM3/9/12
to WireIt
I inherited a code base for a large web application which uses the
WireIt libraries to draw organizational relationships. I have been
the main coder on this project for almost a year but I still cannot
solve a very difficult problem.

The performance of the web application is very slow, almost unusable,
for very large org charts. The end user is stuck using IE7 and IE8 so
it makes it even worse.

After profiling the web application and spending some time to learn
more about WireIt I noticed that onWireMouseMove gets called every
time the mouse moves on the layer even if its not near a wire. I have
tried to change that behavior by adding listeners to the wire elements
and removing them from the layer, but no matter what I do the events
fire off on any mouse movement on the layer. From reading the APIs it
seems that was the intent. However, since it has to iteratively go
over each wire for every pixel the mouse crosses and then determine if
there is a wire drawn there its very slow.

When I profile the page now its using about 60% of the processing in
the onWireMouseMove function and its children.

Is there anyway I can change that behavior so that I can have
"mouseover" listeners for the wire elements and not have to listen to
"mousemove" on the layer and then determine if there is a wire there
by iteratively going over every wire?

Thanks very much for your assistance.

Eric Abouaf

unread,
Apr 3, 2012, 12:55:08 PM4/3/12
to wir...@googlegroups.com
It's a very ugly code indeed... this is why we should use SVG instead...

I would suggest that you remove that part of the code if you don't need "click" or "mousemove" events on the wires.


--
You received this message because you are subscribed to the Google Groups "WireIt" group.
To post to this group, send email to wir...@googlegroups.com.
To unsubscribe from this group, send email to wireit+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/wireit?hl=en.




--
Eric Abouaf
eric....@gmail.com
Tél: 06 29 86 37 89

John Osborne

unread,
May 11, 2012, 1:44:28 PM5/11/12
to WireIt
I wish I could move to SVG, but the end user is using IE8 which does
not natively support SVG :-(

On Apr 3, 9:55 am, Eric Abouaf <eric.abo...@gmail.com> wrote:
> It's a very ugly code indeed... this is why we should use SVG instead...
>
> I would suggest that you remove that part of the code if you don't need
> "click" or "mousemove" events on the wires.
>
> eric.abo...@gmail.com

John Osborne

unread,
May 11, 2012, 7:33:07 PM5/11/12
to WireIt
By the way I did remove the mousemove events and that did help. Thank
You.

On Apr 3, 9:55 am, Eric Abouaf <eric.abo...@gmail.com> wrote:
> It's a very ugly code indeed... this is why we should use SVG instead...
>
> I would suggest that you remove that part of the code if you don't need
> "click" or "mousemove" events on the wires.
>
> eric.abo...@gmail.com
Reply all
Reply to author
Forward
0 new messages