Elektrine lite

← Feed

@AVincentInSpace@furry.engineer

Post #1942228

2026-04-15 19:37 UTC

@Catfish_Man i don't think i'll ever forget how i felt when i replaced a linear search over a large array with a binary search and performance got worse, and then i left the code the same changed the element i was searching for to be something that was known to be at the very beginning or very end of the array and the search time got cut in half, and i realized big-O complexity didn't correspond to real-world performance even on large datasets

Replies (1)

  • @Catfish_Man@mastodon.social 2026-04-15 19:48

    @AVincentInSpace have you seen https://algorithmica.org/en/eytzinger ? It doesn't apply well to binary searches over dynamic data (or at least it requires some up front prep you have to amortize), but I've gotten some fun wins with it

    Open ##1942229