MemoryModule icon indicating copy to clipboard operation
MemoryModule copied to clipboard

USE_BINARY_SEARCH not really used

Open GregSlazinski opened this issue 7 years ago • 4 comments

The new binary name search functionality, says:

#define USE_BINARY_SEARCH to enable it).  This gives a very large
 * speedup for libraries that exports lots of functions.

However USE_BINARY_SEARCH is not really tested anywhere and from what I see binary search is always enabled.

GregSlazinski avatar May 10 '18 21:05 GregSlazinski

The sorted table is created and sorted only once, the first time a lookup by name is requested and it is cached in the module for further lookups: https://github.com/fancycode/MemoryModule/blob/5f83e41c3a3e7c6e8284a5c1afa5a38790809461/MemoryModule.c#L814

Additional lookups will only perform the binary search but not regenerate the table. That is unless I'm missing something - in which case please provide additional information or even better a PR.

However USE_BINARY_SEARCH is not really tested anywhere and from what I see binary search is always enabled.

This comment is probably a leftover of some old code where the binary search was not always used.

fancycode avatar Feb 17 '20 14:02 fancycode

Well, feel free to modify the code locally as you need for debugging ;-)

fancycode avatar Feb 17 '20 14:02 fancycode