golang のテストツールには標準でベンチマークツールが付属しています。例えば、引数 n を貰ってその数分だけメッセージの入ったスライスを返す関数 makeSlice が以下の実装だったとします。 foo.go package foo import "fmt" func makeSlice(n int) []string { var r []string for i := 0; i < n; i++ { r = append(r, fmt.Sprintf("%03d だよーん", i)) } return r } 如何にも遅そうなコードですね。まずはこのコードを単品で計測するベンチマークを書きます。 foo_test.go package foo import "testing" func BenchmarkMakeSlice(b *testing.B) { b.ResetTimer()
Clean and simple string building (fmt) High-performance string concatenation (stringbuilder) Before Go 1.10 (bytebuffer) Clean and simple string building For simple cases where performance is a non-issue, fmt.Sprintf is your friend. It’s clean, simple and fairly efficient. s := fmt.Sprintf("Size: %d MB.", 85) // s == "Size: 85 MB." The fmt cheat sheet lists the most common formatting verbs and fla
14 February 2012 | Jeff Bezanson, Stefan Karpinski, Viral B. Shah, Alan Edelman Jeff Bezanson Stefan Karpinski Viral B. Shah Alan Edelman In short, because we are greedy. We are power Matlab users. Some of us are Lisp hackers. Some are Pythonistas, others Rubyists, still others Perl hackers. There are those of us who used Mathematica before we could grow facial hair. There are those who still can'
Preferred Networks(PFN)は深層学習などの最先端の技術を最短路で実用化することで、これまで解決が困難であった現実世界の課題解決を目指しています。コンピュータビジョン、自然言語処理、音声認識、ロボティクス、コンパイラ、分散処理、専用ハードウェア、バイオインフォマティクス、ケモインフォマティクスといった幅広い分野で研究開発を行っており、それを支えているのが Kubernetes を用いて構築しているオンプレミス/ベアメタルの GPU クラスタです。 本セッションでは、PFN が Kubernetes を用いてクラスタを運用するなかでどのような障害が起きるのかを紹介し、また障害対応をどのように自動化しているのかを具体的に使用/開発したソフトウェアを含めてご紹介します。また Kubernetes クラスタの管理、アップグレードの自動化にも取り組んでおり、それを実現する Clus
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く