Closed Bug 404225 Opened 16 years ago Closed 16 years ago

improve nsCookieService::GetEnumerator() performance

Categories

(Core :: Networking: Cookies, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dwitte, Assigned: dwitte)

References

Details

(Keywords: perf)

Attachments

(1 file)

http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/netwerk/cookie/src/nsCookieService.cpp&rev=1.76#801

it currently calls RemoveExpiredCookies() before handing out the list. this results in an extra hash traversal involving ~1000 entries in common usage. now that sessionstore is calling this method every few seconds, every little bit helps. moving the expiry check into one list traversal will improve perf a tad.
Attached patch like soSplinter Review
Attachment #289204 - Flags: superreview?(mconnor)
Attachment #289204 - Flags: review?(mconnor)
Attachment #289204 - Flags: superreview?(mconnor)
Attachment #289204 - Flags: review?(mconnor)
Comment on attachment 289204 [details] [diff] [review]
like so

shaver likes hash-traversal-squishing bugs!
Attachment #289204 - Flags: superreview?(shaver)
Attachment #289204 - Flags: review?(shaver)
He does -- also likes unit tests.  Trade ya?
the existing unit tests for cookies have it covered :)
Comment on attachment 289204 [details] [diff] [review]
like so

r+sr+a=shaver; we likes some perf
Attachment #289204 - Flags: superreview?(shaver)
Attachment #289204 - Flags: superreview+
Attachment #289204 - Flags: review?(shaver)
Attachment #289204 - Flags: review+
Attachment #289204 - Flags: approval1.9+
Checking in netwerk/cookie/src/nsCookieService.cpp;
/cvsroot/mozilla/netwerk/cookie/src/nsCookieService.cpp,v  <--  nsCookieService.cpp
new revision: 1.90; previous revision: 1.89
done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.