Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USE_BINARY_SEARCH not really used #83

Open
GregSlazinski opened this issue May 10, 2018 · 4 comments
Open

USE_BINARY_SEARCH not really used #83

GregSlazinski opened this issue May 10, 2018 · 4 comments

Comments

@GregSlazinski
Copy link

GregSlazinski commented May 10, 2018

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.

@fancycode
Copy link
Owner

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:

if (!module->nameExportsTable) {

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@fancycode @GregSlazinski and others