<story><title>In-memory key-value store in C, Go and Python </title><url>http://www.darkcoding.net/software/in-memory-key-value-store-in-c-go-and-python/</url></story><parent_chain></parent_chain><comment><author>antirez</author><text>In order to perform such a comparison you can&apos;t write three small trow-away programs, you need to optimize each version at your best for weeks to start to be meaningful, and you need an expert in the three systems.&lt;p&gt;Otherwise the test is still interesting but is: &quot;what is the best language to write a memcached clone without being an expert in a given language, using a few hours&quot;, that still says something about how different the three languages are, but does not say much about what is the &lt;i&gt;best&lt;/i&gt; language to implement the system.&lt;p&gt;Btw in a more serious test another parameter that you did not considered much is very important, that is, memory usage per-key in the three versions, and in general, memory behavior.</text></comment>
<story><title>In-memory key-value store in C, Go and Python </title><url>http://www.darkcoding.net/software/in-memory-key-value-store-in-c-go-and-python/</url></story><parent_chain></parent_chain><comment><author>timtadh</author><text>Looking at the go version[1] I am not sure if will work as expected. Maps in go are not thread safe.[2] So it could be the go version is out performing the others do to the lack of synchronisation. There are several ways to fix this in go, the easiest might just be to use a mutex around the accesses to the cache. But it would probably be better to use a readers writers lock.&lt;p&gt;edit: (that said I am not sure if the C version is thread safe either I haven&apos;t read the docs for the hash table he is using.)&lt;p&gt;edit 2: (looks like the C version is not thread safe either).&lt;p&gt;[1] &lt;a href=&quot;https://github.com/grahamking/Key-Value-Polyglot/blob/master/memg.go&quot; rel=&quot;nofollow&quot;&gt;https://github.com/grahamking/Key-Value-Polyglot/blob/master...&lt;/a&gt;&lt;p&gt;[2] &lt;a href=&quot;http://golang.org/doc/go_faq.html#atomic_maps&quot; rel=&quot;nofollow&quot;&gt;http://golang.org/doc/go_faq.html#atomic_maps&lt;/a&gt;</text></comment>