3 ms·
Exactly! This is best achieved by keeping data on the stack and avoiding allocations as much as possible.
by jupp0r 6y ago
Exactly! This is best achieved by keeping data on the stack and avoiding allocations as much as possible.
- mhh__ 6y agoThe kind of data that is going to generate (enough) cache misses (to be a problem) behind your back is usually the stuff which you can't put on the stack.
- jupp0r 6y agoIt can also be lots of small careless allocations all over the place.
- kstenerud 6y agoYup, and go is particularly bad for this because it handles allocations automatically (and poorly). I can double a go program's performance by going through the memory profile and rearranging the instructions to minimize hidden applications. The worst offender is slices, since you can't mark them read only or stack allocated.