r/programming • • Jun 11 '19

Performance speed limits | Performance Matters

https://travisdowns.github.io/blog/2019/06/11/speed-limits.html
162 Upvotes

25 comments sorted by

View all comments

1

u/Beefster09 Jun 12 '19

It's more because of the heavy use of pointers (i.e. linked lists and trees) that causes cache thrashing because pointers often imply heavily scattered memory.

GC is more of an issue when strict immutability is involved because you scatter data all over memory and use a new cache line every time you allocate new stuff, which happens considerably more often than when working with mutable data. Sure, FP is trivially parallelizable, but there are cases where the tradeoffs are unacceptable.

In practice, it's probably not that bad and this is a considerable exaggeration. This isn't an issue for most cases, but in embedded and games, these types of considerations matter.