Commit 3192ec99 authored by trey's avatar trey
Browse files

3117101 - PLT slows down as history fills up

	I saw a 3% sloth effect from a huge (100k) history.  This change cut that cost in half.
	I think we still have a marginally measurable cost for our worst practical case.

        Reviewed by rjw

        * History.subproj/WebHistoryPrivate.m:
        (-[WebHistoryPrivate insertEntry:atDateIndex:]):  Comment.
        (-[WebHistoryPrivate removeEntryForURLString:]):  Use removeIdentical
	instead of remove, since we don't need to do all the equals comparisons.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3031 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d45e194e
2002-12-12 Trey Matteson <trey@apple.com>
3117101 - PLT slows down as history fills up
I saw a 3% sloth effect from a huge (100k) history. This change cut that cost in half.
I think we still have a marginally measurable cost for our worst practical case.
Reviewed by rjw
* History.subproj/WebHistoryPrivate.m:
(-[WebHistoryPrivate insertEntry:atDateIndex:]): Comment.
(-[WebHistoryPrivate removeEntryForURLString:]): Use removeIdentical
instead of remove, since we don't need to do all the equals comparisons.
2002-12-12 Richard Williamson <rjw@apple.com>
Changes to fix 3116584.
......@@ -247,6 +261,7 @@
2002-12-10 Trey Matteson <trey@apple.com>
3092966 - going back goes to different page (can't go back to a POST page)
3123450 - if the user refuses a navigation, the b/f menus is wrong
We will rePOST data upon back/forward/refresh if our caches fail us. The policy delegate
gets a crack at confirming this operation. Latent bugs where the policy delegate was double
......
......@@ -98,6 +98,7 @@ - (void)insertEntry: (WebHistoryItem *)entry atDateIndex: (int)dateIndex
entryDate = [entry lastVisitedDate];
entriesForDate = [_entriesByDate objectAtIndex: dateIndex];
count = [entriesForDate count];
// optimized for inserting oldest to youngest
for (index = 0; index < count; ++index) {
if ([entryDate compare: [[entriesForDate objectAtIndex: index] lastVisitedDate]] != NSOrderedAscending) {
break;
......@@ -126,7 +127,7 @@ - (BOOL)removeEntryForURLString: (NSString *)URLString
ASSERT(foundDate);
entriesForDate = [_entriesByDate objectAtIndex: dateIndex];
[entriesForDate removeObject: entry];
[entriesForDate removeObjectIdenticalTo: entry];
// remove this date entirely if there are no other entries on it
if ([entriesForDate count] == 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment