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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

A Journey building a fast JSON parser and full JSONPath, Oj for Go

111 点作者 dcu将近 5 年前

6 条评论

quelsolaar将近 5 年前
I wrote a fast C json parser a few years ago (+600megs/s) And it was an interesting experience. Validating the json roughly halved the performance. The most interesting performance gain was going from using aligned structs to packed byte offsets being accessed using memcpy. It added 20-30%. The overhead of aligning was nothing compared to fewer cache misses. In the end i found that making a truly fast json parser mostly depend on what you parse it to. Like, is the structure read only, and how fast is it to access?
评论 #23740702 未加载
jeffbee将近 5 年前
There is a nugget buried at the bottom of this: you will get different output for different kinds of for ... range or for i ... loops. You&#x27;d think these are equivalent:<p><pre><code> for i = range arr { sum += arr[i] } for _, c = range arr { sum += c } </code></pre> ... but the latter is 4 bytes shorter in x86. The compiler takes things literally.
评论 #23740560 未加载
svnpenn将近 5 年前
&gt; Both the Ruby Oj and the C parser OjC are the best performers in their respective languages.<p>Um, no, they arent:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;simdjson&#x2F;simdjson" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;simdjson&#x2F;simdjson</a>
评论 #23738397 未加载
throwaway77384将近 5 年前
How does this compare to something like <a href="https:&#x2F;&#x2F;github.com&#x2F;valyala&#x2F;fastjson" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;valyala&#x2F;fastjson</a> ?
评论 #23742179 未加载
nautilus12将近 5 年前
I wonder how people that make super specific things like this their whole career make money. I wonder if they are independently wealthy and just do things like this for fun
评论 #23742548 未加载
评论 #23742206 未加载
remorses将近 5 年前
Go is becoming the language to implement json parsers
评论 #23739200 未加载