LaKraven / LKSL

LaKraven Studios Standard Library
http://otapi.com
Other
51 stars 15 forks source link

Provide IFDEFs to use TLKSortedList instead of TLKDictionary in the Event Engine. #94

Closed LaKraven closed 9 years ago

LaKraven commented 9 years ago

At present, the Event Engine uses Dictionaries quite extensively. These can be a significant benefit when the number of Listeners subscribed to Events at any one time is sufficiently high, but actually produces lower performance when there are fewer. This is because a hash has to be performed for each lookup, and hashing takes time.

For smaller projects with fewer Listeners, a Binary Lookup may very-well be more efficient.

An IFDEF can switch between modes at compile-time, and I'm going to call it LKSL_EVENTENGINE_USEBINARYLISTS

When that Define is set, the Event Engine will use TLKSortedList instead of TLKDictionary... otherwise, TLKDictionary will be used (as it is presently).

NOTE: This define can temporarily (at least) be set for FreePascal to side-step the lack of functionality with TLKDictionary on FreePascal (at least until issue #80 is resolved).

This issue can only be completed after issue #93 has been completed.

LaKraven commented 9 years ago

Superseded by the Generics Redux project!

There will no longer be any Delphi-only Generics Collections in the LKSL! They're all going custom, fully cross-compatible!