Closed Bug 205895 Opened 21 years ago Closed 21 years ago

nsIMIMEInfo.getFileExtensions should use nsIStringEnumerator

Categories

(Core :: Networking, defect, P2)

x86
Windows 2000
defect

Tracking

()

RESOLVED FIXED
mozilla1.5alpha

People

(Reporter: alecf, Assigned: alecf)

References

Details

(Keywords: memory-footprint, Whiteboard: fix in hand)

Attachments

(1 file)

USing spacetrace I noticed that on startup on windows,
nsExternalHelperAppService scans the list of every file extension in every mime
type. I think its reading in mime types from the system. This accounted for some
300 seperate 24 byte allocations from calling nsIMIMEInfo::GetFileExtensions
(well, 3 to 4 bytes really, but with alignment and malloc overhead, they're at
least 24 bytes)

I switched to using nsIUTF8StringEnumerator, and I managed to eliminate all of
those allocations, save the 8-12 bytes for the enumerator itself.

patch forthcoming.
and here's the patch, looking for reviews.
Comment on attachment 123480 [details] [diff] [review]
switch to string enumerator

no huge rush on these, but the patch is pretty straight forward.
Attachment #123480 - Flags: superreview?(darin)
Attachment #123480 - Flags: review?(bz-bugspam)
Status: NEW → ASSIGNED
Priority: -- → P2
Whiteboard: fix in hand
Target Milestone: --- → mozilla1.5alpha
Comment on attachment 123480 [details] [diff] [review]
switch to string enumerator

i like it!  sr=darin
Attachment #123480 - Flags: superreview?(darin) → superreview+
Blocks: 162116
Comment on attachment 123480 [details] [diff] [review]
switch to string enumerator

r=me if you put back the |var extString = "";| that you removed in the last
hunk in that diff -- that's still needed...

Looks nice.  ;)
Attachment #123480 - Flags: review?(bz-bugspam) → review+
fix is in!
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Blocks: 209860
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: