<p>A completely unscientific micro-benchmark on a raspberry Pi (model A) showing impressive performance improvements over Go version 1.7.
I used the <a href="https://github.com/zaf/g711">g711</a> package:</p>
<pre><code>Go 1.7.4:
BenchmarkEncodeAlaw 500 2953814 ns/op 13.78 MB/s
BenchmarkDecodeAlaw 1000 1353389 ns/op 15.04 MB/s
BenchmarkAlaw2Ulaw 2000 815997 ns/op 24.94 MB/s
BenchmarkAEncode 500 2948536 ns/op 13.80 MB/s
BenchmarkUEncode 500 3303488 ns/op 12.32 MB/s
BenchmarkTranscode 2000 824287 ns/op 24.69 MB/s
BenchmarkUDecode 1000 2330969 ns/op 8.73 MB/s
BenchmarkADecode 1000 2334973 ns/op 8.72 MB/s
BenchmarkEncodeUlaw 500 3300406 ns/op 12.33 MB/s
BenchmarkDecodeUlaw 1000 1354516 ns/op 15.03 MB/s
BenchmarkUlaw2Alaw 2000 822775 ns/op 24.74 MB/s
Go 1.8-rc1:
BenchmarkEncodeAlaw 1000 1451539 ns/op 28.04 MB/s
BenchmarkDecodeAlaw 2000 668480 ns/op 30.45 MB/s
BenchmarkAlaw2Ulaw 3000 438258 ns/op 46.44 MB/s
BenchmarkAEncode 1000 1450844 ns/op 28.06 MB/s
BenchmarkUEncode 1000 1521578 ns/op 26.75 MB/s
BenchmarkTranscode 3000 451114 ns/op 45.11 MB/s
BenchmarkUDecode 1000 1441110 ns/op 14.12 MB/s
BenchmarkADecode 1000 1443054 ns/op 14.10 MB/s
BenchmarkEncodeUlaw 1000 1519568 ns/op 26.79 MB/s
BenchmarkDecodeUlaw 2000 667550 ns/op 30.49 MB/s
BenchmarkUlaw2Alaw 3000 449110 ns/op 45.32 MB/s
</code></pre>
<p>Speed has doubled in most test cases, quite an impressive improvement. I suppose most of it is because of the SSA back end being now used on ARM architectures. The Go team did again some amazing job.</p>
<p>Edit: Formatting</p>
<p>Edit 2: Added <a href="https://godoc.org/golang.org/x/tools/cmd/benchcmp">benchcmp</a> results as <a href="/u/hmmdar">u/hmmdar</a> suggested:</p>
<pre><code>benchmark old ns/op new ns/op delta
BenchmarkEncodeAlaw 2960400 1456210 -50.81%
BenchmarkDecodeAlaw 1356913 668245 -50.75%
BenchmarkAlaw2Ulaw 812808 436220 -46.33%
BenchmarkAEncode 2947194 1456290 -50.59%
BenchmarkUEncode 3301212 1524986 -53.81%
BenchmarkTranscode 815995 449569 -44.91%
BenchmarkUDecode 2323288 1439515 -38.04%
BenchmarkADecode 2304512 1444513 -37.32%
BenchmarkEncodeUlaw 3306432 1524012 -53.91%
BenchmarkDecodeUlaw 1351595 668260 -50.56%
BenchmarkUlaw2Alaw 815100 449057 -44.91%
benchmark old MB/s new MB/s speedup
BenchmarkEncodeAlaw 13.75 27.95 2.03x
BenchmarkDecodeAlaw 15.00 30.46 2.03x
BenchmarkAlaw2Ulaw 25.04 46.66 1.86x
BenchmarkAEncode 13.81 27.95 2.02x
BenchmarkUEncode 12.33 26.69 2.16x
BenchmarkTranscode 24.94 45.27 1.82x
BenchmarkUDecode 8.76 14.14 1.61x
BenchmarkADecode 8.83 14.09 1.60x
BenchmarkEncodeUlaw 12.31 26.71 2.17x
BenchmarkDecodeUlaw 15.06 30.46 2.02x
BenchmarkUlaw2Alaw 24.97 45.32 1.81x
</code></pre>
<hr/>**评论:**<br/><br/>karna22: <pre><p>I'm currently working on a Pi project. This is awesome news. I'm hoping that memory consumption also went down. Will try it out today.</p></pre>hmmdar: <pre><p>Check out the tool benchcmp it does a great job of providing nicely formated difference between two becnhmark output test files</p></pre>k0k0l4l4: <pre><p>Thanks for the tip, that's indeed a handy tool. Updated the post.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传