Hacker News new | ask | show | jobs
by 37ef_ced3 1734 days ago
In my experience, the performance of carefully written Go is not far from the performance of C. Perhaps between a factor of 1.5x and 2x slower, if that. Otherwise, I agree with your comments.
1 comments

Carefully written Go vs uncarefully written C? Sure.

Carefully written Go vs carefully written C? I still think C would win by a factor of 10.

Like I said, most slowness comes from memory access and fragmentation. In C you can use strategies like arena allocations. In Go you cannot turn of the GC.

If you want to build a custom allocator (use freelists and vectors of types) you can do all of that in Go and C. There's nothing stopping you from writing custom memory allocators in Go.