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
120
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
150
Getting to the post-industrial age of DevOps
nickbruun
2
110
At løbe med sakse (Danish)
nickbruun
1
180
Lessons learned defying Joel Spolsky with Django
nickbruun
145
35k
Other Decks in Programming
See All in Programming
VSCodeでのDatabricks開発もお勧めしたい/I would also recommend Databricks development with VSCode.
kazumain
0
260
MicrosoftのPlatform Engineeringガイドを読んで実際になにかやってみた
ymd65536
1
340
Azure OpenAI Serviceのプロンプトエンジニアリング入門
tomokusaba
3
710
#phpcon_odawara オープン・クローズドなテストフィクスチャを求めて / open closed test fixtures
77web
3
230
2 週間で Twitter Bot を作ってみた
contour_gara
0
550
使ってみよう Azure AI Document Intelligence
kosmosebi
2
320
"config" ってなんだ? / What is "config"?
okashoi
0
240
スキーマ駆動開発による品質とスピードの両立 - 私達は何故、スキーマを書くのか
kentaroutakeda
0
170
Komplexe Oberflächen mit SVG und der Web Animation API
joergneumann
0
670
AWS Application Composerで始める、 サーバーレスなデータ基盤構築 / 20240406-jawsug-hokuriku-shinkansen
kasacchiful
1
260
DMMプラットフォームがTiDB Cloudを採用した背景
pospome
8
4.1k
エンターテイメント業界で利用されるAWS
demuyan
0
210
Featured
See All Featured
Building Adaptive Systems
keathley
31
1.9k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.1k
Stop Working from a Prison Cell
hatefulcrawdad
266
19k
The Illustrated Children's Guide to Kubernetes
chrisshort
31
46k
[RailsConf 2023] Rails as a piece of cake
palkan
23
4k
How to train your dragon (web standard)
notwaldorf
73
5.2k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
78
43k
Fashionably flexible responsive web design (full day workshop)
malarkey
398
65k
Designing on Purpose - Digital PM Summit 2013
jponch
110
6.5k
What’s in a name? Adding method to the madness
productmarketing
PRO
16
2.6k
Practical Orchestrator
shlominoach
182
9.7k
The Brand Is Dead. Long Live the Brand.
mthomps
49
29k
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