TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Gnatsd: a high performance NATS messaging server written in Go

33 点作者 krobertson超过 11 年前

3 条评论

DrJosiah超过 11 年前
This is probably a bit off topic, but I notice that they implemented their own hashmap with pluggable hash functions. Awesome in theory (and practice), though I notice that the performance of their custom hash table is poorer than Go&#x27;s built-in hash map (Go&#x27;s hashmap takes 1&#x2F;2, 3&#x2F;4, and 9&#x2F;10th the time of their hashmap for small, medium, and large keys, respectively - though this could be related to the updated aes hash in Go, and that my processor supports it).<p>While looking through the implementations, the Gnatsd hashmap implementation is a simple table with buckets, where as the Go hashmap also uses a table with buckets, though each &quot;bucket&quot; has 8 slots by default (and does subsequent chaining). Go&#x27;s chunking of buckets helps caches work better, reduces random reads, and helps to minimize overhead (fewer pointers if you have fixed-size data). Read the first 83 lines of <a href="http://golang.org/src/pkg/runtime/hashmap.c" rel="nofollow">http:&#x2F;&#x2F;golang.org&#x2F;src&#x2F;pkg&#x2F;runtime&#x2F;hashmap.c</a> to see what good structure design and experimentation gets you.<p>Does someone have an example where a &#x27;go test --bench=&quot;.&quot; -gcflags=&quot;-B&quot;&#x27; call in the gnatsd&#x2F;hashmap path actually comes out ahead for the Gnatsd hashmap using a recent Go?
评论 #6575487 未加载
clumsysmurf超过 11 年前
At first glance, NATS looks similar in goal to MQTT. Can anyone describe the differences?
评论 #6574801 未加载
评论 #6574575 未加载
orenmazor超过 11 年前
at first I definitely thought this was related to the old gnu bug tracker.