Closed Bug 158860 Opened 23 years ago Closed 23 years ago

Reduce memory cost of using HTML Source multiple times

Categories

(SeaMonkey :: Composer, defect)

All
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.2alpha

People

(Reporter: cmanske, Assigned: cmanske)

Details

(Keywords: perf, Whiteboard: fixed 1.1)

Attachments

(1 file)

Each time we switch from "Normal" editing mode to "HTML Source" and make any change, when we switch back to "Normal" we reparse and rebuild the entire document. The transaction system caches *all* DOM nodes because of this. With the current unlimited under model, this can cause large amounts of memory to be used after repeated uses of HTML Source mode. We can limit this to just one document tree in the cache by limiting the undo stack to just one when going from HTML Source mode to Normal mode.
Attached patch patch v1Splinter Review
To test: 1. Do some editing in Composer page. Type some, insert an image, insert an HR. 2. Use Undo to see that all of the editing tasks can be undone, using Undo multiple times. 3. Click on "HTML Source" tab and make some changes to the source 4. Return to "Normal Mode" 5. You can use "Undo" once -- it should undo all the changes you made in HTML Source. 6. After using Undo once, Undo is disabled and you cannot undo any of he actions previous to the HTML Source changes.
Status: NEW → ASSIGNED
Keywords: nsbeta1, patch, perf, review
Whiteboard: [FIX IN HAND]need r=,sr=
Target Milestone: --- → mozilla1.2alpha
Comment on attachment 92394 [details] [diff] [review] patch v1 sr=kin@netscape.com Shouldn't the max transaction count used be 1 instead of 2?
Attachment #92394 - Flags: superreview+
Whiteboard: [FIX IN HAND]need r=,sr= → [FIX IN HAND]need r=
Note: Setting the maxTransaction count to 1 is what I tested: + gEditor.transactionManager.maxTransactionCount = 1 so that's what I'll checkin.
Comment on attachment 92394 [details] [diff] [review] patch v1 r=brade
Attachment #92394 - Flags: review+
Whiteboard: [FIX IN HAND]need r= → [FIX IN HAND]need approval
Comment on attachment 92394 [details] [diff] [review] patch v1 a=asa (on behalf of drivers) for checkin to 1.1
Attachment #92394 - Flags: approval+
fixed in trunk
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Keywords: nsbeta1, patch, review
Resolution: --- → FIXED
Whiteboard: [FIX IN HAND]need approval → fixed 1.1
Assuming I have understood the purpose of this bug, a similar practice is followed by MS Frontpage, too. I was wondering why, until I saw the reason here. But I think it should be mentioned in 1.1 release notes.
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: