Closed Bug 124686 Opened 23 years ago Closed 23 years ago

nsRegionWin::SetTo should use SetRectRgn

Categories

(Core Graveyard :: GFX, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla0.9.9

People

(Reporter: bratell, Assigned: bratell)

References

Details

(Keywords: perf)

Attachments

(1 file)

In nsRegionWin::SetTo we destroy the old region and creates a new one. It would
be faster to just set the existing region to a new position with SetRectRgn.
That would save us a DeleteObject and I bet SetRectRgn is much faster than the
CreateRectRgn we use right now and also it would save a couple of byte of code size.

Right now nsRegionWin::SetTo is 7% of the problematic DHTML page in bug 124178
but that extremely high percentage is probably just because it's called too
often. I think.
Keywords: perf
Here is a patch. I fixed Init to also don't delete/create when it can as well
just set the region. Reviews? Kevin?
A SetRectRgn is ~2us. A CreateRectRgn was ~6us.
Blocks: 21762
Keywords: patch
Blocks: 124178
Comment on attachment 68772 [details] [diff] [review]
Replace DeleteObject/CreateRectRgn with SetRectRgn

r=kmcclusk@netscape.com.
Attachment #68772 - Flags: review+
Rod can you take a look at Daniel's patch?
Target Milestone: --- → mozilla0.9.9
Comment on attachment 68772 [details] [diff] [review]
Replace DeleteObject/CreateRectRgn with SetRectRgn

sr=attinasi.  Please indicate how this was tested - I am assuming it was tested
:)
Attachment #68772 - Flags: superreview+
I've been running with it for a week now and I'm still alive. :-)
I've also stepped through the code and the same things happens now as before.

Taking for checkin.
Assignee: kmcclusk → bratell
Fix checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
No longer blocks: 21762
Blocks: 21762
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: