golang 1.7について

い つ も の

ブログの三日坊主?発動! 極端なんですよねー。自分のブログ。

環境のバージョンあげちゃうかもって話でたので、 Golang v1.7について、おさらいしたい

概要

2016年12月4日時点でのGolangの最新バージョンは1.7.4です。

v1.6 -> v1.7

  • コンパイラの改善による最適化と高速化
  • import をより効率よく処理できるようになった
    • 高速化とバイナリサイズの削減
  • 標準ライブラリ拡充
  • vendorディレクトリ(1.6でデフォルト対応になったやつ)が常時有効になった
    • 有効化オプションの廃止

参考文献

Tool系

cgo package

cgoパッケージ:C言語を呼ぶGoパッケージの生成が可能 (こいつ使ったことないのでよくわかんないけど)

-> C, C++, Objective-c, SWIGに加えて Fortranのソースファイルも増えた

Go command

基本的な命令は変わってないけどいくつか変わりました。

やっぱり注目すべき変更はVendoring supportですかね。

下記は更新あり

  • Go doc
  • Go doc
  • Go vet
  • Go tool dist
  • Go tool trace

パフォーマンス

(めんどくさくなったので引用。改善されたよってこと)

引用 https://tip.golang.org/doc/go1.7?la=ja#performance

As always, the changes are so general and varied that precise statements about performance are difficult to make. Most programs should run a bit faster, due to speedups in the garbage collector and optimizations in the core library. On x86-64 systems, many programs will run significantly faster, due to improvements in generated code brought by the new compiler back end. As noted above, in our own benchmarks, the code generation changes alone typically reduce program CPU time by 5-35%.

There have been significant optimizations bringing more than 10% improvements to implementations in the crypto/sha1, crypto/sha256, encoding/binary, fmt, hash/adler32, hash/crc32, hash/crc64, image/color, math/big, strconv, strings, unicode, and unicode/utf16 packages.

Garbage collection pauses should be significantly shorter than they were in Go 1.6 for programs with large numbers of idle goroutines, substantial stack size fluctuation, or large package-level variables.

Core library

下記に変更あったよー

  • golang.org/x/net/context -> context (標準ライブラリに)
  • net/http/httptrace
  • testing
  • Runtime

Minor Change

目通しておくと不幸せにならないかも??


あとがき

やっぱり、手間にならない程度でブログ書いてこう。 今日みたいなまとめは英語読むのしんどい&そもそもGoあんまりよくわかってないから、 リハビリ的なものじゃなかった・・・