Closed Bug 149702 Opened 23 years ago Closed 23 years ago

[PATCH] Pre-Size nsXMLMIMEDataSource::mInfoArray before appending elements to it

Categories

(SeaMonkey :: General, defect)

defect
Not set
minor

Tracking

(Not tracked)

VERIFIED INVALID

People

(Reporter: paper, Assigned: paper)

Details

(Keywords: perf)

Attachments

(1 file, 1 obsolete file)

mInfoArray currently contains 24 elements (23 ifndef MOZ_SVG). This list is static, so why not init the array to 24 before appending. nsSupportsArray grows its array size by increments of 8. This'll save 2 grow calls. I really don't know what impact removing 2 grow calls have, but it's a optimization, nonetheless!
Attached patch a simple patch (obsolete) — Splinter Review
Summary: Pre-Size mInfoArray before appending elements to it → Pre-Size nsXMLMIMEDataSource::mInfoArray before appending elements to it
Thanks for the patch...Marking NEW for patch review and goodness.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: patch, review
Summary: Pre-Size nsXMLMIMEDataSource::mInfoArray before appending elements to it → [PATCH] Pre-Size nsXMLMIMEDataSource::mInfoArray before appending elements to it
Not familiar with this, can someone explain how this is Networking?
Benjamin, I put it in Networking only because nsXMLMIMEDataSource is in the /mozilla/netwerk/ directory. If you have a better component for it, don't hesitate to move it! :)
-> browser-general, b/c matti knows all.
Assignee: new-network-bugs → Matti
Component: Networking → Browser-General
QA Contact: benc → imajes-qa
Comment on attachment 87268 [details] [diff] [review] Set Initial Size of mInfoObjects and mInfoArray to size of static list r=biesi I trust that you your count is correct
Attachment #87268 - Flags: review+
Assignee: Matti → paper
Comment on attachment 87268 [details] [diff] [review] Set Initial Size of mInfoObjects and mInfoArray to size of static list patch seems fine, but is this code actually run? uriloader/exthandler/nsExternalHelperAppService overrides necko's impl of nsIMIMEService, which is the only code that uses nsXMLMIMEDataSource (or so i thought). sr=darin if you verify that this code is actually used by mozilla.
Darin, I asked that same question a day after I created the patch. I haven't had time yet to look into it, but it's on my list of todos. I always assumed it ran, but haven't seen any obvious way it is. If it isn't run, the static list is just silly and causes one more step in adding a mimetype (a image decoder, for example)
per bug 172963 sounds like this file is indeed unused. could be WONTFIX or INVALID, going for the second.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
nsXMLMIMEDataSource.cpp is now been cvs removed.. verifying invalid :)
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: