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 for speed
Search
Nick Bruun
September 18, 2014
Programming
0
150
Go for speed
A look at a use case for Go at Iconfinder, which shaved ~40 ms off asset load times.
Nick Bruun
September 18, 2014
Tweet
Share
More Decks by Nick Bruun
See All by Nick Bruun
The evolution of the Web stack
nickbruun
0
190
Getting to the post-industrial age of DevOps
nickbruun
2
160
At løbe med sakse (Danish)
nickbruun
1
220
Lessons learned defying Joel Spolsky with Django
nickbruun
145
35k
Other Decks in Programming
See All in Programming
How to stabilize UI tests using XCTest
akkeylab
0
130
GoのDB アクセスにおける 「型安全」と「柔軟性」の両立 - Bob という選択肢
tak848
0
210
CS教育のDX AIによる育成の効率化
niftycorp
PRO
0
140
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
500
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
610
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
210
20260315 AWSなんもわからん🥲
chiilog
2
160
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
290
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
270
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
1k
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
2.5k
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
5
1.1k
Featured
See All Featured
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
140
The Pragmatic Product Professional
lauravandoore
37
7.2k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
Why Our Code Smells
bkeepers
PRO
340
58k
Docker and Python
trallard
47
3.8k
Facilitating Awesome Meetings
lara
57
6.8k
Abbi's Birthday
coloredviolet
2
5.4k
It's Worth the Effort
3n
188
29k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
990
Java REST API Framework Comparison - PWX 2021
mraible
34
9.2k
How to Think Like a Performance Engineer
csswizardry
28
2.5k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Transcript
Go for speed
Nick Bruun github.com/nickbruun @nickbruun bruun.co CTO @ Iconfinder Fairly carnivorous
None
None
None
Trouble in icon paradise
None
None
None
None
41 ms average response time from Django application during peak
hours
~2,000 ms wasted per search
Perceivably slower
The internals
None
Icon ID Icon version ID Raster size https://www.iconfinder.com/icons/298255/677266/128/raster https://cdn0.iconfinder.com/data/icons/seo-smart-pack/128/ grey_new_seo2-43-128.png
Public raster URL Protected raster URL
None
Constant
Signing requests
https://www.iconfinder.com/icons/298255/677266/128/raster?token=…
None
we know if the user has access right now When
returning the link,
we know if the user has access right now When
returning the link,
We’re okay with “right now” being an approximation
Time limited token
<token secret> = "<expiration timestamp>-<session ID>-<nonce>-<URL>"
<token secret> = "<expiration timestamp>-<session ID>-<nonce>-<URL>" <signature> = hmac_sha1(<token secret>,
<shared secret>)
<token secret> = "<expiration timestamp>-<session ID>-<nonce>-<URL>" <signature> = hmac_sha1(<token secret>,
<shared secret>) <token> = "<expiration timestamp>-<nonce>-base64(<signature>)"
But, who checks the token?
Enter Go The World’s least Google-able language… from Google
None
Why Go?
Networked service
Highly concurrent ~3,000 requests/second from 100 connections/core
Low memory footprint 14.09 MiB after 21 days
Low CPU usage
Static binary Cross-compilation = deployment heaven
Less decisions to make
Caveats
Structured logging
DIY
Mature runtime != Mature language
Conciseness 608 lines of code
The end result
1.2 ms average response time at peak hours
0.1 % CPU usage at peak hours
Go is awesome
Go is awesome for simple services
Go is a trade-off
Go is a trade-off – choose wisely
return