Re:Two years of production Go at CloudFlare
by tptacek on Monday November 11, 2013 @08:02PM
(#6715199)
It will probably not be significantly faster than Golang for this workload.
Re:Two years of production Go at CloudFlare
by halayli on Monday November 11, 2013 @08:32PM
(#6715297)
It can be. You have total control of memory layout. You can gain a lot of performance by considering locality of reference, slab allocators, and parsing DNS packets in general will most probably be much faster.
Re:Two years of production Go at CloudFlare
by tptacek on Monday November 11, 2013 @08:41PM
(#6715321)
Golang also allows control over memory layout.
Re:Two years of production Go at CloudFlare
by halayli on Monday November 11, 2013 @10:09PM
(#6715614)
of course it does, but it does it in a way that aims to provide an overall good performance for all apps. But it doesn't mean that's the best performance you can get.
Re:Two years of production Go at CloudFlare
by halayli on Monday November 11, 2013 @10:32PM
(#6715687)
C doesn't control memory. brk() does. There are various malloc libraries out there to improve the way malloc manages memory.
But ideally you don't want to allocate memory at all. You want to have memory preallocated and preferably accessing a page that's still in cache. You can control memory pages in C because it doesn't manage that for you.
Re:Two years of production Go at CloudFlare
by tonyplee on Tuesday November 12, 2013 @01:02AM
(#6716133)
+1
Re:Two years of production Go at CloudFlare
by tptacek on Monday November 11, 2013 @10:22PM
(#6715656)
What "way" would that be? Golang's approach to data layout is very similar to C's.
Re:Two years of production Go at CloudFlare
by acdha on Tuesday November 12, 2013 @08:35AM
(#6717675)
> It will be faster than what Go has to offer.
You meant “could theoretically be” – you're gambling that you'll have development resources and expertise to make optimizations which aren't possible in Go, that those optimizations will actually matter to the critical path, and that you're more likely to reach the point of being able to make those optimizations than the Go team will be able to optimize further.
In the absence of something showing a strong, unavoidable disadvantage for Go, that's a lot to take on faith.
https://github.com/halayli/lthread