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
210
Lessons learned defying Joel Spolsky with Django
nickbruun
145
35k
Other Decks in Programming
See All in Programming
AI & Enginnering
codelynx
0
140
日本だけで解禁されているアプリ起動の方法
ryunakayama
0
360
Gemini for developers
meteatamel
0
120
Event Storming
hschwentner
3
1.3k
Python’s True Superpower
hynek
0
190
Go 1.26でのsliceのメモリアロケーション最適化 / Go 1.26 リリースパーティ #go126party
mazrean
1
190
Apache Iceberg V3 and migration to V3
tomtanaka
0
220
Claude Code、ちょっとした工夫で開発体験が変わる
tigertora7571
0
170
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
430
モジュラモノリスにおける境界をGoのinternalパッケージで守る
magavel
0
2.6k
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
22
8k
CopilotKit + AG-UIを学ぶ
nearme_tech
PRO
1
110
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
463
34k
WCS-LA-2024
lcolladotor
0
470
The World Runs on Bad Software
bkeepers
PRO
72
12k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
300
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
290
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
130
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
370
Rebuilding a faster, lazier Slack
samanthasiow
85
9.4k
How to Think Like a Performance Engineer
csswizardry
28
2.5k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
310
How to train your dragon (web standard)
notwaldorf
97
6.5k
How to make the Groovebox
asonas
2
2k
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