Closed Bug 851264 Opened 11 years ago Closed 11 years ago

Change eventSource in dbg-client.jsm to use Set (and maybe Map) for listeners

Categories

(DevTools :: Debugger, defect)

21 Branch
defect
Not set
minor

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: bbenvie, Assigned: bbenvie)

Details

Attachments

(1 file)

eventSource currently uses a plain object to store the mapping of events to listeners, and the listener groups are arrays. eventSource.removeListener works by filtering the array of listeners and creating an entirely new array, so is inefficient (eventSource.addOneTimeListener uses this).

As the event handler methods tend to be hot code, I think it would worth optimizing by switching to Sets for the listeners instead of arrays. A more minor optimization would be to switch the events object to use a Map.
Assignee: nobody → bbenvie
Since we're planning to migrate to using Addon SDK's EventEmitter, this is unneeded.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: