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
130
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
160
Getting to the post-industrial age of DevOps
nickbruun
2
130
At løbe med sakse (Danish)
nickbruun
1
200
Lessons learned defying Joel Spolsky with Django
nickbruun
145
35k
Other Decks in Programming
See All in Programming
Deoptimization: How YJIT Speeds Up Ruby by Slowing Down / RubyKaigi 2025
k0kubun
1
1.9k
Contribute to Comunities | React Tokyo Meetup #4 LT
sasagar
0
590
Fiber Scheduler vs. General-Purpose Parallel Client
hayaokimura
1
290
Memory API : Patterns, Performance et Cas d'Utilisation
josepaumard
1
170
Amazon CloudWatchの地味だけど強力な機能紹介!
itotsum
0
230
VitestのIn-Source Testingが便利
taro28
8
2.4k
Orleans + Sekiban + SignalR でリアルタイムWeb作ってみた
tomohisa
0
230
Cline with Amazon Bedrockで爆速開発体験ハンズオン/ 株式会社ブリューアス登壇資料
mhan
0
110
Bedrock×MCPで社内ブログ執筆文化を育てたい!
har1101
7
1.4k
Cursor/Devin全社導入の理想と現実
saitoryc
28
21k
flutter_kaigi_mini_4.pdf
nobu74658
0
140
ComposeでWebアプリを作る技術
tbsten
0
130
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
The World Runs on Bad Software
bkeepers
PRO
68
11k
Making the Leap to Tech Lead
cromwellryan
133
9.2k
A Tale of Four Properties
chriscoyier
159
23k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
47
2.7k
Designing Experiences People Love
moore
142
24k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.4k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
5
550
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
2.9k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
Designing for humans not robots
tammielis
253
25k
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