Closed
Bug 164278
Opened 23 years ago
Closed 23 years ago
reading cookie file seems very inefficient
Categories
(Core :: Networking: Cookies, defect, P2)
Core
Networking: Cookies
Tracking
()
RESOLVED
FIXED
mozilla1.2beta
People
(Reporter: Brade, Assigned: Brade)
Details
(Keywords: perf, Whiteboard: chimera)
Attachments
(2 files)
|
4.30 KB,
patch
|
morse
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
|
3.82 KB,
patch
|
morse
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
While starting up Chimera, the cookie code made 183 read calls to the system
(out of 828 total read calls). The cookies file appears to be read in 128 byte
blocks rather than a more optimal size like 4k or 8k. Increasing the buffer
size would reduce the number of system calls made and increase performance.
Also, I'm somewhat surprised that the buffer is not passed around but instead is
a static. Wouldn't it be clearer to pass around the buffer?
| Assignee | ||
Updated•23 years ago
|
Comment 1•23 years ago
|
||
Is there a reason that the component is set to Chimera rather than browser?
Also should the OS be All instead of MacOSX?
Priority: -- → P2
| Assignee | ||
Comment 2•23 years ago
|
||
changing product/component and platform/OS
(I was busy filing lots of performance and memory leak issues and just kept
reusing the same page without resetting everything.)
Component: General → Cookies
OS: MacOS X → All
Product: Chimera → Browser
Hardware: Macintosh → All
Whiteboard: chimera
Version: unspecified → other
Updated•23 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.2beta
Comment 3•23 years ago
|
||
All that is required is to change the definition of bufsize at
http://lxr.mozilla.org/seamonkey/source/extensions/cookie/nsUtils.cpp#50 ?
| Assignee | ||
Comment 4•23 years ago
|
||
Actually, I would think that there is a better class out there to use to read
the file into a buffer. At a minimum, increasing the buffer size would be ok.
However, I really don't see any reason for the cookie code to keep around a
static buffer (no matter what size it is).
| Assignee | ||
Comment 5•23 years ago
|
||
here is a proof of concept or a first attempt (whichever way you want to think
about it). This is more inline with what I was thinking. I was actually
hoping to use the bufferedInputStream class but that is in necko and I'm not
sure that can be used in this module.
Comment 6•23 years ago
|
||
Kathy,
Thanks. I was about to start on this bug today, so your "proof of concept" is
very timely. I look it over right now and either use it as is or modify it if
necessary.
Comment 7•23 years ago
|
||
Kathy's proof of concept is much more than that -- it is a final patch. I'm for
checking it in as is.
r = morse
Updated•23 years ago
|
Attachment #96898 -
Flags: review+
| Assignee | ||
Comment 8•23 years ago
|
||
previous patch is for Chimera branch; this patch is for trunk
| Assignee | ||
Comment 9•23 years ago
|
||
cc heikki for sr= on both patches
-->brade
Assignee: morse → brade
Status: ASSIGNED → NEW
Comment 10•23 years ago
|
||
Comment on attachment 97071 [details] [diff] [review]
this is the patch to apply to the trunk (essentially same except string changes made to api on trunk)
r=morse for trunk patch
Comment 11•23 years ago
|
||
Comment on attachment 96898 [details] [diff] [review]
proof of concept / first attempt
>Index: nsUtils.cpp
>+// static PRInt32 next = bufsize, count = bufsize;
nit: remove this comment. sr=darin
Attachment #96898 -
Flags: superreview+
Comment 12•23 years ago
|
||
Comment on attachment 97071 [details] [diff] [review]
this is the patch to apply to the trunk (essentially same except string changes made to api on trunk)
sr=darin
Attachment #97071 -
Flags: superreview+
Updated•23 years ago
|
Attachment #97071 -
Flags: review+
Comment 13•23 years ago
|
||
Patch checked in on trunk. Kathy, could you please do the checkin for the
Chimera branch. Don't forget to remove the comment that darin noted. Thanks.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•