Closed
Bug 115129
Opened 24 years ago
Closed 24 years ago
stream loader optimizations
Categories
(Core :: Networking, defect, P3)
Core
Networking
Tracking
()
RESOLVED
FIXED
mozilla0.9.8
People
(Reporter: darin.moz, Assigned: darin.moz)
References
Details
(Keywords: perf, Whiteboard: [ready to land])
Attachments
(1 file)
3.68 KB,
patch
|
gagan
:
review+
brendan
:
superreview+
|
Details | Diff | Splinter Review |
noticed that nsStreamLoader does a couple things that could be improved:
1) nsStreamLoader::OnDataAvailable calls Read instead of ReadSegments on the
input stream, resulting in an extra buffer copy.
2) nsStreamLoader::OnDataAvailable simply appends to mData, which is a
nsCString. I noticed that at startup there are a number of CSS and JS files for
which OnDataAvailable is called several times. The result is several
reallocations of mData. This can be avoided by preallocating mData in
OnStartRequest to a size equal to the expected content length. This requires
modifications to the JAR channel since it does not expose the content length of
the JAR item.
I'm not sure how much of a performance cost these things are... my initial
evaluation under Linux didn't show much of an improvement. I'm hoping that
Win2k will show otherwise.
Assignee | ||
Updated•24 years ago
|
Assignee | ||
Comment 1•24 years ago
|
||
this patch gave me a 0.9% startup improvement, and a 0.5% page load improvement
on win2k.
Assignee | ||
Comment 2•24 years ago
|
||
gagan: can you r= this patch?
Comment on attachment 61673 [details] [diff] [review]
v1.0 patch
WriteSegmentFun? :-) That the best you could come up with?... r=gagan
Attachment #61673 -
Flags: review+
Comment 4•24 years ago
|
||
Comment on attachment 61673 [details] [diff] [review]
v1.0 patch
+ if (NS_SUCCEEDED(rv))
+ (*aInputStream)->Available((PRUint32 *) &mContentLength);
Do we know that Available returns the jar member's content-length, always?
/be
Attachment #61673 -
Flags: superreview+
Assignee | ||
Comment 5•24 years ago
|
||
brendan: yes... or at least that is how it is currently implemented. available
returns the "real size" of the zip archive segment.
dveditz: can you double check this?
Assignee | ||
Updated•24 years ago
|
Whiteboard: [ready to land]
Comment 6•24 years ago
|
||
Available() will return what's left of the data in the jar member. Before the
first read this will always be the full uncompressed size of the member.
Assignee | ||
Comment 7•24 years ago
|
||
fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 8•23 years ago
|
||
I found when i add this patch,on my source,then build on solaris,my mozilla
page loading speed change slower.so i suggest we should research it.
Assignee | ||
Comment 9•23 years ago
|
||
Antonio.Xu: what is your page load test? this would only effect pages w/
external css or js files.
You need to log in
before you can comment on or make changes to this bug.
Description
•