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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Golang only 2x ruby at net/http level and same as ruby at web framework level?

3 点作者 gankgu超过 10 年前

4 条评论

nostrademons超过 10 年前
TechEmpower has it at about 3x Ruby at net&#x2F;http level, but close to 10x on BeeGo vs. Sinatra.<p><a href="https://www.techempower.com/benchmarks/#section=data-r9&amp;hw=peak&amp;test=json" rel="nofollow">https:&#x2F;&#x2F;www.techempower.com&#x2F;benchmarks&#x2F;#section=data-r9&amp;hw=p...</a><p>(Interestingly, JRuby is actually within about 10% of Go.)<p>This doesn&#x27;t surprise me all that much: the guts of Ruby&#x27;s HTTP parsing &amp; network handling is generally done in C. It&#x27;s only when you layer all the code in Rails through the default Ruby interpreter that it gets slow.
coldtea超过 10 年前
What does this &quot;hello world&quot; measure?<p>It doesn&#x27;t measure Ruby&#x27;s speed, that&#x27;s for sure. The IO is C, and the HTTP parsing and network operations are also C in Ruby.<p>Also the frameworks you used are minimal (for both Ruby and Go) so their overhead is negligible as well. Again you&#x27;re mostly measuring some C calls vs Go calls.<p>So, a more accurate title would be: &quot;Golang only 2x C at net&#x2F;http and same as C at web framework level&quot;.<p>Now, try a full blown Rails service or a Sinatra endpoind that DOES some processing, not just prints something, and compare it with the same thing in Go.
gankgu超过 10 年前
But in actual world, people will be attracted by post like &quot;Iron.io Blog: How We Went from 30 Servers to 2: Go&quot;. And like to think so we can use it do faster and easier !<p>Also, for start-ups, It&#x27;s important to choose a language that has a certain level of performance rather than rewrite all codes later.
smt88超过 10 年前
Cross-language benchmarks are nonsense.<p>Hardware can be scaled. Time cannot. Use the platform that saves you the most time (now and when you&#x27;re in &quot;maintenance&quot; mode) and worry about performance later.