Closed
Bug 97528
Opened 23 years ago
Closed 23 years ago
1200 urls created on startup about:blank
Categories
(Core :: Networking, defect, P3)
Core
Networking
Tracking
()
RESOLVED
FIXED
mozilla0.9.5
People
(Reporter: dp, Assigned: darin.moz)
References
Details
(Keywords: perf, Whiteboard: fixed-on-trunk)
Attachments
(3 files, 15 obsolete files)
(deleted),
text/plain
|
Details | |
(deleted),
patch
|
dp
:
review+
waterson
:
superreview+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
darin.moz
:
review+
brendan
:
superreview+
|
Details | Diff | Splinter Review |
There are about 190 chrome urls and they cause
- 190 clones
- 190 jar urls
- 190 resource urls of 6 unique jar files
- 190 file urls
Thats the bulk of the url creations. I have patch eliminating the 190 clones. I
think the jar urls are going to be hard to eliminate. The resource urls can be
probably cached. The file urls can be eliminated along with their channel being
created.
Reporter | ||
Updated•23 years ago
|
Reporter | ||
Comment 1•23 years ago
|
||
Reporter | ||
Comment 2•23 years ago
|
||
Assignee | ||
Comment 3•23 years ago
|
||
Assignee | ||
Comment 4•23 years ago
|
||
this patch eliminates creation of the file:// URL and channel. it also
eliminates stat'ing the file on the UI thread, which is never ever a good idea.
Assignee | ||
Comment 5•23 years ago
|
||
On my system (733Mhz 128Mb RAM redhat 7.0 linux), this patch saved about 0.9% on
startup, which amounts to about only 1/10th of a second. also, it turns out
that this patch does not eliminate creation of the file:// urls, so that could
explain why the benefit of the patch is not so great.
Assignee | ||
Comment 6•23 years ago
|
||
Assignee | ||
Comment 7•23 years ago
|
||
i'm working on a patch which would make nsResProtocolHandler::NewURI return a
resolved URI, so as to alleviate the need for nsResChannel.
Assignee | ||
Updated•23 years ago
|
Priority: -- → P3
Target Milestone: --- → mozilla0.9.5
Assignee | ||
Comment 8•23 years ago
|
||
Assignee | ||
Comment 9•23 years ago
|
||
the latest patch does the following:
1) adds: string nsIResProtocolHandler::resolveURI(in nsURI resourceURI)
2) nsResProtocolHandler::NewChannel calls resolveURI, and returns a channel for
the resolved uri.
3) nsJARChannel checks if the uri is resource and calls resolveURI to get the
file uri and then a nsIFile -- to be replaced with nsIFileURL::getFile, which
implies a separate nsResURL implementation (probably aggregating nsStdURL).
as a result, a file:// url and channel are never created, and the jar channel
gets a nsIFile without instantiating a downloader.
adding nsResURL is probably the last step to wrapping up this patch.
Comment 10•23 years ago
|
||
r=hyatt on dp's patch of 8/29/01 17:15.
Assignee | ||
Comment 11•23 years ago
|
||
Assignee | ||
Comment 12•23 years ago
|
||
Assignee | ||
Comment 13•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Attachment #47633 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Attachment #47599 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Attachment #47573 -
Attachment is obsolete: true
Comment 14•23 years ago
|
||
darin: you can do a cvs diff -uN after cvs adding any new files, to create an
all-in-one patch. FYI, and review from me in a bit.
/be
Reporter | ||
Updated•23 years ago
|
Attachment #47567 -
Attachment mime type: text/html → text/plain
Reporter | ||
Comment 15•23 years ago
|
||
Comment on attachment 47570 [details] [diff] [review]
Eliminating the chrome url Clone()
Hyatt reviewed this r=hyatt
Attachment #47570 -
Flags: review+
Reporter | ||
Comment 16•23 years ago
|
||
Reporter | ||
Updated•23 years ago
|
Attachment #48047 -
Attachment description: Eliminates another 200 url creations + 192 Parse() on url → Eliminates about 400 Parse() on url
Comment 17•23 years ago
|
||
dp, some unsolicited comments on the latest patch (which is very cool, btw):
-SplitURL(nsIURI* aChromeURI, nsCString& aPackage, nsCString& aProvider,
nsCString& aFile)
+SplitURL(nsIURI *aChromeURI, nsCString& aPackage, nsCString& aProvider,
nsCString& aFile,
+ PRBool *modified = nsnull)
aModified, please follow the formal argument naming convention.
- if (! str)
+ if (! (const char *)str)
return NS_ERROR_INVALID_ARG;
Is str.get() better here than (const char *)str? Just askin'. Also, why not
NS_ERROR_OUT_OF_MEMORY (pre-existing code, but fix it anyway)?
+ PRBool nofile = PR_FALSE;
if (aFile.Length() == 0) {
+ nofile = PR_TRUE;
Nit: PRBool noFile = (aFile.Length() == 0); if (noFile) {...} seems clearer and
as, if not more, efficient in compiled code.
/be
Reporter | ||
Comment 18•23 years ago
|
||
Thanks brendan. All review comments accepted and changes made. Will attach patch.
> Is str.get() better here than (const char *)str? Just askin'.
nsXPIDLString.h sez (const char *) is deprecated. So I guess .get() is better.
Reporter | ||
Comment 19•23 years ago
|
||
Reporter | ||
Updated•23 years ago
|
Attachment #48186 -
Attachment description: Eliminate 400 nsStdURL::Parse() w/brenda's review comments → Eliminate 400 nsStdURL::Parse() w/brendan's review comments
Assignee | ||
Updated•23 years ago
|
Attachment #47733 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Attachment #47734 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
Attachment #47735 -
Attachment is obsolete: true
Assignee | ||
Comment 20•23 years ago
|
||
Assignee | ||
Comment 21•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Attachment #48204 -
Attachment is obsolete: true
Assignee | ||
Updated•23 years ago
|
OS: Linux → All
Hardware: PC → All
Assignee | ||
Updated•23 years ago
|
Status: NEW → ASSIGNED
Comment 22•23 years ago
|
||
Comment on attachment 48205 [details] [diff] [review]
v1.1 "cvs diff -uN" version + minor fix for msvc++
looks good. be sure to remove the nsResChannel from the mac project.
Attachment #48205 -
Flags: superreview+
Reporter | ||
Comment 23•23 years ago
|
||
r=dp
- Put back the changes to nsCStringKey creation
- take care of new files being added on mac
Assignee | ||
Comment 24•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Attachment #48205 -
Attachment is obsolete: true
Assignee | ||
Comment 25•23 years ago
|
||
Comment on attachment 48228 [details] [diff] [review]
v1.2 new patch following code review with dp
forgot to use cvs -uN
Attachment #48228 -
Attachment is obsolete: true
Assignee | ||
Comment 26•23 years ago
|
||
Assignee | ||
Comment 27•23 years ago
|
||
Comment on attachment 48229 [details] [diff] [review]
v1.2 new patch following code review with dp + nsResURL.{h,cpp}
r=dp
Attachment #48229 -
Flags: review+
Reporter | ||
Updated•23 years ago
|
Attachment #47570 -
Attachment is obsolete: true
Reporter | ||
Updated•23 years ago
|
Attachment #48047 -
Attachment is obsolete: true
Reporter | ||
Updated•23 years ago
|
Attachment #48186 -
Attachment is obsolete: true
Reporter | ||
Comment 28•23 years ago
|
||
Reporter | ||
Comment 29•23 years ago
|
||
Comment on attachment 48342 [details] [diff] [review]
Eliminate 200 url creations and 400 url Parse() on startup with blank page.
Hyatt reviewed this.
Attachment #48342 -
Flags: review+
Comment 30•23 years ago
|
||
Comment on attachment 48342 [details] [diff] [review]
Eliminate 200 url creations and 400 url Parse() on startup with blank page.
sr=waterson
Attachment #48342 -
Flags: superreview+
Reporter | ||
Comment 31•23 years ago
|
||
My patch checked in.
Assignee | ||
Comment 32•23 years ago
|
||
http://bugzilla.mozilla.org/attachment.cgi?id=48229 checked in on trunk.
resolving bug FIXED.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 33•23 years ago
|
||
This patch might cause Bug 98838. Please take a look.
Assignee | ||
Comment 34•23 years ago
|
||
backed out my patch due to bug 98838.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 35•23 years ago
|
||
Darin, sorry I didn't sr= -- should I look for a new patch? Who super-reviewed
the one that got checked in, anyway?
/be
Assignee | ||
Comment 36•23 years ago
|
||
brendan: i used dougt's review as sr= ... i'm working on a new patch to resolve
the regression (over the weekend) resulting from my checkin.
Assignee | ||
Comment 37•23 years ago
|
||
Assignee | ||
Updated•23 years ago
|
Attachment #48229 -
Attachment is obsolete: true
Assignee | ||
Comment 38•23 years ago
|
||
the problem with the previous patch was in the way i was attempting to reuse the
nsStdURL implementation. in particular, nsStdURL::Equals requires its argument
to also be a nsStdURL if the two are to be considered equal (ie. they do not
just have to have similar uri strings). so, i've redone nsResURL to make it
simply inherit from nsStdURL, overriding nsIFileURL::GetFile only. this seems
to do the trick, and is IMO a much simpler and more efficient solution.
dp, brendan: can you guys please review this patch? thanks!
Status: REOPENED → ASSIGNED
Assignee | ||
Comment 39•23 years ago
|
||
Comment on attachment 49064 [details] [diff] [review]
v1.3 revised patch to avoid bug 98838
obsolete per review with dp
Attachment #49064 -
Attachment is obsolete: true
Assignee | ||
Comment 40•23 years ago
|
||
Assignee | ||
Comment 41•23 years ago
|
||
Comment on attachment 49163 [details] [diff] [review]
v1.4 revised per comments from dp
wrong patch
Attachment #49163 -
Attachment is obsolete: true
Assignee | ||
Comment 42•23 years ago
|
||
Assignee | ||
Comment 43•23 years ago
|
||
Comment on attachment 49164 [details] [diff] [review]
v1.4 revised patch per comments from dp
has r=dp, waiting for sr=
Attachment #49164 -
Flags: review+
Comment 44•23 years ago
|
||
Comment on attachment 49164 [details] [diff] [review]
v1.4 revised patch per comments from dp
- Use do_GetIOService() instead of do_GetService(kIOServiceCID, &rv) with yet another static CID for the I/O service.
- Why is mSubstitutions a mapping from "host" to an nsISupportsArray when we use only the first element of the array?
Can you file a bug to simplify to a scalar instead of a vector mapped type here?
- Move nsJarChannel::EnsureJARFileAvailable's fileURL decl down to its first assignment, and initialize the decl.
Oh wait, you can't because of the two goto error; statements -- much as I like a
well-used goto (break across multiple switch/loop levels, typically),
these two are gratuitous. Can you eliminate them without hideously overindenting the code after each?
Nice cleanup in general, sr=brendan@mozilla.org if you fix the above fluff.
We need more of this kind of bogo-thread-safety and false generality policing.
/be
Attachment #49164 -
Flags: superreview+
Assignee | ||
Comment 45•23 years ago
|
||
brendan: thanks for the comments.
1. does using do_GetIOService really reduce the number of statics? afterall, it
is an inline function. maybe i'm mistaken, but i thought that the compiler
would simply inline the code preventing the linker from knowing that the static
CID is replicated. do_GetIOService is/was the only reason nsNetUtil.h is
included, which really slows down the build each time it is included/modified.
2. see bug 99410
3. i should be able to clean up EnsureJARFileAvailable.
Comment 46•23 years ago
|
||
1. How often is nsNetUtil.h modified? I'd rather consolidate declarations, if
not compiler-propagated nsCID constants (which are coalesced by the GNU
toolchain, at least). Build time seems like the wrong deciding factor here.
2&3. Thanks!
/be
Assignee | ||
Comment 47•23 years ago
|
||
brendan: knowing that some compilers will do the right thing is enough for me.
thanks!
Assignee | ||
Updated•23 years ago
|
Whiteboard: ready-to-land
Assignee | ||
Comment 48•23 years ago
|
||
fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 23 years ago → 23 years ago
Resolution: --- → FIXED
Whiteboard: ready-to-land → fixed-on-trunk
You need to log in
before you can comment on or make changes to this bug.
Description
•