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
140
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
150
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
GoLab2025 Recap
kuro_kurorrr
0
3.8k
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
270
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
150
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
700
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
0
460
Python札幌 LT資料
t3tra
7
1.1k
これならできる!個人開発のすゝめ
tinykitten
PRO
0
150
Cap'n Webについて
yusukebe
0
160
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
170
まだ間に合う!Claude Code元年をふりかえる
nogu66
5
930
組み合わせ爆発にのまれない - 責務分割 x テスト
halhorn
1
180
Basic Architectures
denyspoltorak
0
190
Featured
See All Featured
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
140
Designing for humans not robots
tammielis
254
26k
Become a Pro
speakerdeck
PRO
31
5.8k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2k
How to Ace a Technical Interview
jacobian
281
24k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
0
230
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.8k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
110
Speed Design
sergeychernyshev
33
1.5k
Raft: Consensus for Rubyists
vanstee
141
7.3k
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