Elektrine lite

← Feed

@Catfish_Man@mastodon.social

Post #1484999

2026-04-15 16:22 UTC

Refcount contention? Fighting over a cache line. Branch mispredict? Wouldn't have hurt much if resolving the comparison wasn't waiting on a load. You found an approach with better computational complexity? It probably has worse memory access patterns at realistic sizes, just use an array. Fancy ECS for your game? Just syntax sugar for AoS->SoA. Compacting garbage collection overhead? Sometimes *less than zero* because it improves memory layout. Cache rules everything around me

Replies (4)

  • @guenther@chaos.social 2026-04-15 16:58

    @Catfish_Man Implemented everything in Python and now it's slow as fuck? Well, uhm, …

    Open ##1942226

  • @gim@lou.lt 2026-04-15 18:21

    @Catfish_Man RAM, RAM bill y'all

    Open ##1942227

  • @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

    Open ##1942228

  • @thomas@mastodon.deniau.org 2026-04-16 07:45

    @Catfish_Man it’s one of the questions in my standard algorithms interview. « Congrats, you found the O(n)!! But my own solution is n log n and faster, why? »

    Open ##1942232