3 ms·
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. Otherwi
by 37ef_ced3 5y 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.
- hsn915 5y agoCarefully 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.
- 37ef_ced3 5y agoIf 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.