Currently, I am in the process of developing a JavaScript application designed for generating simple diagrams. However, I have encountered some performance issues specifically in Internet Explorer version 8.
This application allows users to draw lines on a diagram (refer to the picture). There are two primary handlers responsible for drawing a line. The ONMOUSEUP event captures the user's clicks to indicate placement of a point on the line and initiate a new segment (lines consist of various segments).
On the other hand, an ONMOUSEMOVE handler creates a faded-out segment as a visual guide for the user while they are drawing the line.
For a snapshot of the line-drawing process, please view these images: https://i.sstatic.net/AxcFr.jpg http://i51.tinypic.com/fxjqf.jpg
In cases where a user clicks the mouse (mousedown) but does not release it and begins dragging the mouse around instead, IE becomes completely unresponsive. After a period of time, it eventually resumes functionality as normal.
Conversely, Chrome handles this situation seamlessly; during the dragging operation, the MOUSEMOVE handler continues to function correctly, and the point is placed only after the ONMOUSEUP event is triggered.
My current hypothesis is that Explorer may be single-threaded, meaning it registers the MOUSEMOVE events but executes them only after the completion of the ONMOUSEUP event (effectively causing nothing to occur during the drag operation). Unfortunately, I am unsure how to verify if this theory holds true or how to effectively address the issue.
I conducted profiling utilizing the built-in JS profiler in IE8, and both handlers were called the standard number of times with no excessive function calls that could lead to freezing. The profiler remains frozen when IE freezes and produces no output until the browser unfreezes, at which point the results appear similar to those before the freeze occurred.
EDIT: Further insights from the dynaTrace profiler tool can be viewed in the timeline here: .