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
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
210
Getting to the post-industrial age of DevOps
nickbruun
2
170
At løbe med sakse (Danish)
nickbruun
1
230
Lessons learned defying Joel Spolsky with Django
nickbruun
145
35k
Other Decks in Programming
See All in Programming
その問い、本当に正しいですか?AI時代のエンジニアに必要な哲学と認知科学 / ai-philosophy-cognitive-science
minodriven
11
5.9k
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
21
6.8k
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
710
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
260
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
140
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
550
Performance Engineering for Everyone
elenatanasoiu
0
190
Creating Composable Callables in Contemporary C++
rollbear
0
150
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.7k
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
550
C# and C++ Interoperability - cho-dotnetnew
harukasao
0
290
Webフレームワークの ベンチマークについて
yusukebe
0
170
Featured
See All Featured
Making Projects Easy
brettharned
120
6.7k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
530
Abbi's Birthday
coloredviolet
2
8.1k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
How to make the Groovebox
asonas
2
2.2k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
Music & Morning Musume
bryan
47
7.2k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
560
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
270
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
170
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