Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Go Performans Rehberi
Search
Oğuzhan
July 25, 2020
Technology
350
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Go Performans Rehberi
https://gophercon.ist/
için hazırladığım sunum
Oğuzhan
July 25, 2020
More Decks by Oğuzhan
See All by Oğuzhan
Yazılımda Ustalaşmak
oguzhan
0
130
Kuşbakışı GO
oguzhan
2
410
Hayatınızı Değiştirecek 10 Araç (Hosting Meetup)
oguzhan
0
790
MaestroPanel HTK
oguzhan
0
85
Other Decks in Technology
See All in Technology
LLMリーダーボードアップデートに向けたAgentic Math_SWEのトレースについて
nejumi
0
170
クラウドセキュリティ入門 ~安全なクラウド利用のための基礎知識~
lhazy
0
1.1k
AI Agent を本番環境へ―― Microsoft Foundry × Azure Serverless で作る Enterprise-Ready な基盤
shibayan
PRO
1
920
人手不足への挑戦:車両保全を支えるIoTとクラウド内製化の道【SORACOM Discovery 2026】
soracom
PRO
0
170
Escolhendo LLMs na Prática: Lições Reais em Busca Agêntica no Mercado Livre —TDC 2026 Floripa
jpbonson
0
110
AIツールを導入しても生産性はあがらない? カオナビが直面した 3つの壁と乗り越え方。/ Overcoming 3 Barriers to AI-Driven Productivity at kaonavi
kaonavi
0
480
AIエージェントに財布を渡す日 ― 承認付き"買い物エージェント"を作って実演
yama3133
0
110
WEBフロントエンド研修【MIXI 26新卒技術研修】
mixi_engineers
PRO
2
840
AI研修(Day2)【MIXI 26新卒技術研修】
mixi_engineers
PRO
2
1.6k
もう一度考える SRE チームの作り方・育て方 / Rethinking SRE #1: Building and Growing SRE Teams
rrreeeyyy
1
170
AI驚き屋発見器
yama3133
1
390
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
53k
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Embracing the Ebb and Flow
colly
88
5.1k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Typedesign – Prime Four
hannesfritz
42
3.1k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Technical Leadership for Architectural Decision Making
baasie
3
450
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
Raft: Consensus for Rubyists
vanstee
141
7.6k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
400
WCS-LA-2024
lcolladotor
0
780
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.4k
Transcript
Oğuzhan Yılmaz Go Performans Rehberi
min. Go 1.14
if > switch
13.5 ns/op 15.5 ns/op
12.1 ns/op
strconv > fmt
BenchmarkStrconv-16 19381725 67.5 ns/op 32 B/op 1 allocs/op BenchmarkFmt-16 5839038
222 ns/op 72 B/op 3 allocs/op 67.5 ns/op
make([]int, 0, 10) > []int{}
BenchmarkMakeSliceWithCap-16 1000000000 0.234 ns/op 0 B/op 0 allocs/op BenchmarkMakeSlice-16 65739
17390 ns/op 16376 B/op 11 allocs/op 0.234 ns/op
strings.Builder > “a” + “b”
BenchmarkStringBuildNaive-16 6573120 174 ns/op 32 B/op 6 allocs/op BenchmarkStringBuildBuilder-16 19740784
62.4 ns/op 64 B/op 1 allocs/op 62.4 ns/op
bytes.Replace > strings.Replace bytes Concat > strings Concat bytes Concat
> strings Join
70.1 ns/op BenchmarkBytesReplace-4 20000000 70.1 ns/op 32 B/op 1 allocs/op
BenchmarkStringsReplace-4 10000000 132 ns/op 64 B/op 2 allocs/op
https://github.com/valyala/fasthttp
binary.BigEndian.PutUint32 > binary.Write
1075 ns/op 113 ns/op
sync.Pool
None
_ = make([]byte, 10<<30)
runtime.MemProfileRate = 0 https://golang.org/pkg/runtime/
syscal.SYS_MMAP
None
map[int]int{} > map[string]int{}
3 ms/op
json.Marshal(Struct) > json.Marshal(Map)
BenchmarkMarshallStruct-16 4721078 230 ns/op 64 B/op 2 allocs/op BenchmarkMakeSlice-16 1843551
665 ns/op 512 B/op 10 allocs/op 230 ns/op
Atomic > Mutex
BenchmarkIncrementMutex-16 87149690 12.3 ns/op 0 B/op 0 allocs/op BenchmarkIncrementMutexNoDefer-16 99812758
12.2 ns/op 0 B/op 0 allocs/op BenchmarkIncrementAtomic-16 286304998 4.19 ns/op 0 B/op 0 allocs/op BenchmarkConcurrentMutex-16 226051 5104 ns/op 16 B/op 1 allocs/op BenchmarkConcurrentMutexNoDefer-16 235743 4941 ns/op 16 B/op 1 allocs/op BenchmarkConcurrentAtomic-16 260210 4635 ns/op 16 B/op 1 allocs/op 4.19 ns/op
1. https://github.com/dgryski/go-perfbook/blob/master/performance.md 2. https://stephen.sh/posts/quick-go-performance-improvements 3. https://hashrocket.com/blog/posts/go-performance-observations 4. https://gist.github.com/vitalyisaev2/5791627ffc48f10c2fde22c2a5dd32ee