Skip to content
Homunculus edited this page Jun 6, 2025 · 7 revisions

About

Binder is a binary search library for those who need quick, efficient lookups on large datasets in games where lookup performance matters and linear searches or simple hashmaps just won’t cut it.

Important concepts

Binary search is a widely used algorithm for efficiently locating a value in a list by repeatedly dividing the search space in half until the target is found. Its efficiency comes from operating in logarithmic time, which keeps searches fast even as data grows large.

However, this speed comes with a trade-off: binary search requires that the data be sorted according to the type of lookup you're performing (e.g., alphabetically for a word or prefix search). This leads to three important considerations:

  • Applicability – Binary search is not suitable for search criteria that cannot be expressed through ordering, such as full-text search.
  • Mutability – It works best with static or rarely changing datasets (due to the ordering requirement).
  • Duplication – The data has to either be sorted before each lookup or stored multiple times in different order.

For the third point, Binder adopts the latter strategy—maintaining a sorted copy, but optimizes this approach by storing only references to the original data entries, avoiding duplication and reducing the memory overhead.

In Game Making, this kind of algorithm is especially useful in scenarios like word games with large word lists (supporting lookups by prefix, suffix, anagram, length, etc.), or data-heavy games that involve extensive stat tracking and retrieval.

Documentation

Quick start guide

Function reference

Support

Please write a new issue in case of problems, questions or suggestions.

License

Released under the MIT license. Can be used in personal and commercial projects. Credit not required but appreciated.

Clone this wiki locally