3 ms·
It's not only about time, it's about GC pauses. If you allocate hundreds of KB on each request (even simple stuff like health checks, or frequently polls for "i
by ithkuil 12y ago
It's not only about time, it's about GC pauses.
If you allocate hundreds of KB on each request (even simple stuff like health checks, or frequently polls for "is there anything ready yet" (in memory not db access etc), you will have a higher GC cost, and possibly having long GC pauses.
Go 1.5 is going to improve on the GC pauses, but another way of improving it is to just create garbage (by reusing memory). Go doesn't have manual heap allocation and free, but you can easily achieve manual memory management by simple means like handling your own pools.