rhelgeby / smprojectbase

Automatically exported from code.google.com/p/smprojectbase
0 stars 0 forks source link

Event forwarding optimization #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently the event forwarder loops through all of the modules checking if 
the event should be sent.  This can be inefficient when there are tons of 
modules.

Solution:

Create arrays for each item in the ProjectEvents enum:
new Handle:modulelist[ProjectEvents];

-Initialize an adt array for each project event to store in this array.
-In the event register function, add the module to the array under the 
event being registered.
-In the event forwarder, loop through its respect array to only process 
modules using the event.

Better to use more memory than more CPU.

Original issue reported on code.google.com by andrewbo...@gmail.com on 8 Feb 2010 at 8:47

GoogleCodeExporter commented 9 years ago

Original comment by andrewbo...@gmail.com on 9 Feb 2010 at 1:42