Closed Bug 70328 Opened 24 years ago Closed 24 years ago

Absolute positioning of <div> using javascript is slow

Categories

(Core :: DOM: Core & HTML, defect, P4)

defect

Tracking

()

VERIFIED DUPLICATE of bug 69354
mozilla1.0

People

(Reporter: gregory, Assigned: jst)

References

()

Details

(Keywords: perf)

Attachments

(1 file)

This is really a testcase in search of a bug, but I hope it might be useful to
someone.  

I used very informal benchmarking to test the above URL in both Mozilla
2001022311 and IE5.5sp1.  Mozilla used 2X as much processor time moving the News
<div> around the screen.  All the time is spent in the mousemove() function
which is only 3 lines long.  I figured this would be a good test case someone
could profile against.  

I suspect the text hilighting code, but it could be the JS engine also.  Only
way to know is to profile it.  I did remove the text from the <div> with the
mousedown event.  This did reduce processor usage by 20% as there was no text to
hilight.  However, I think that the browser is still checking to see if text
needs to be hilighted and therfore slowing things down.
Keywords: perf
This is a really interesting testcase! Here is the function mousemove()
that Greg pointed out above: 
 

function mousemove(evt)
{
 var myEvent = evt;
 if (document.all) myEvent = event;

 if(!(varmousedown == 0))
 {
  document.getElementById("counter").style.left = myEvent.clientX-varmousedown;
  document.getElementById("counter").style.top = myEvent.clientY-10;
 }
}



I'm going to presume this is a DOM issue, and reassign. I don't have the
necessary profiling application to know for sure; if it is actually JS Engine, 
please reassign back - thanks 
Assignee: rogerl → jst
Status: UNCONFIRMED → NEW
Component: Javascript Engine → DOM Level 0
Ever confirmed: true
QA Contact: pschwartau → desale
The problem described in bug 64516 also shows up on this page but there might be
more to this one than there is to the other one, I doubt it's a DOM problem tho...
Depends on: 64516
Priority: -- → P4
Hardware: PC → All
Target Milestone: --- → mozilla1.0
Bug 69354 is probably a dupe of this bug.
Since this one is newer than bug 69354 I'm marking this aa dup of that bug.

*** This bug has been marked as a duplicate of 69354 ***
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
VERIFIED dup
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: