[ 
https://issues.apache.org/jira/browse/XERCESJ-1331?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ludger Bünger updated XERCESJ-1331:
-----------------------------------

    Description: 
When dispatching Events, the method Vector.contains is called unnecessary often 
which needs O(n) runtime with n being the number of event listeners registered 
upon a given node.

Instead it is advisable to transiently store a 'removed' state upon each 
listener entry object instead having to do an expensive "contains" call upon 
the vector containing the event listener entries.

Attached patch transiently stores the "removed" state of an listener entry 
instead of checking "contains".

  was:
When dispatching Events, the method Vector.contains is called unnecessary often.

Attached patch transiently stores the "removed" state of an listener entry 
instead of checking "contains".


> Performance Hotspot in dispatchEvent
> ------------------------------------
>
>                 Key: XERCESJ-1331
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1331
>             Project: Xerces2-J
>          Issue Type: Improvement
>          Components: DOM (Level 2 Events)
>    Affects Versions: 2.9.1
>            Reporter: Ludger Bünger
>         Attachments: xercesDocumentImplEventListenerRemovalCheckPatch.txt
>
>
> When dispatching Events, the method Vector.contains is called unnecessary 
> often which needs O(n) runtime with n being the number of event listeners 
> registered upon a given node.
> Instead it is advisable to transiently store a 'removed' state upon each 
> listener entry object instead having to do an expensive "contains" call upon 
> the vector containing the event listener entries.
> Attached patch transiently stores the "removed" state of an listener entry 
> instead of checking "contains".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to