Bug 23665 - WebHTMLView.mm removes NSNotification observation inefficiently
Summary: WebHTMLView.mm removes NSNotification observation inefficiently
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: John Sullivan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-31 16:45 PST by John Sullivan
Modified: 2009-01-31 17:00 PST (History)
0 users

See Also:


Attachments
Patch to use removeObserver efficiently (12.52 KB, patch)
2009-01-31 16:47 PST, John Sullivan
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Sullivan 2009-01-31 16:45:15 PST
-[WebHTMLView close] calls [NSNotificationCenter removeObserver:self], which is measurably slower than calling the flavor of removeObserver: that takes a specific notification.

Also, removeObserver: is called when the view is removed from the window as well as when the view is closed, resulting in NSNotificationCenter looking through its tables of observer/notification pairs twice for the same pair.
Comment 1 John Sullivan 2009-01-31 16:47:31 PST
Created attachment 27225 [details]
Patch to use removeObserver efficiently
Comment 2 Darin Adler 2009-01-31 16:49:56 PST
Comment on attachment 27225 [details]
Patch to use removeObserver efficiently

r=me
Comment 3 John Sullivan 2009-01-31 17:00:34 PST
Committed revision 40468