4 ms·
https://shane.ai/posts/cgo-performance-in-go1.21/ https://shane.ai/posts/cgo-performance-in-go1.21/
by lossolo 2y ago
https://shane.ai/posts/cgo-performance-in-go1.21/ https://shane.ai/posts/cgo-performance-in-go1.21/
- mananaysiempre 2y ago> Cgo calls take about 40ns, about the same time encoding/json takes to parse a single digit integer. As an aside, that sure feels like a lot of time to parse a single-digit integer. Not catastrophic by any means, but still, 100 to 200 cycles is a sign the program is definitely Doing Something. Perhaps that’s the memory allocator?
- ecnahc515 2y agoIt's probably just because it's using reflection which is pretty slow in general. Lots of conditions/branches and boxing/unboxing of values.