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
150
0
Share
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
More Decks by Nick Bruun
See All by Nick Bruun
The evolution of the Web stack
nickbruun
0
200
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
[KCD Czech] eBPF Meets the GPU: Future of AI Infra Observability
doniacld
0
130
柔軟なPDFレイアウトエディタを支える型システム設計 — Discriminated UnionとConditional Typeの実践
minako__ph
4
1.2k
AIエージェントと協働するCLI開発 — BunとOpenClawで学んだこと
yoshikouki
1
230
Spec-Driven Development with AI-Agents: From High-Level Requirements to Working Software
antonarhipov
2
400
Transactional Change Stream Processing With Debezium and Apache Flink
gunnarmorling
1
140
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
250
Moments When Things Go Wrong
aurimas
3
130
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
140
Claspは野良GASの夢をみるか
takter00
0
140
今さら聞けないCancellationToken
htkym
0
210
密結合なバックエンドから TypeScript のコードを生成する
kemuridama
1
400
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
160
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
GitHub's CSS Performance
jonrohan
1033
470k
HDC tutorial
michielstock
2
680
Rails Girls Zürich Keynote
gr2m
96
14k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
RailsConf 2023
tenderlove
30
1.5k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
810
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
190
Building the Perfect Custom Keyboard
takai
2
780
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
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