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
AgentCoreとHuman in the Loop
har1101
5
220
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
410
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
160
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
130
CSC307 Lecture 03
javiergs
PRO
1
490
公共交通オープンデータ × モバイルUX 複雑な運行情報を 『直感』に変換する技術
tinykitten
PRO
0
210
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
290
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
370
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
440
登壇資料を作る時に意識していること #登壇資料_findy
konifar
3
750
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
Patterns of Patterns
denyspoltorak
0
1.3k
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
300
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
150
We Are The Robots
honzajavorek
0
160
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
75
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.6k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
97
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
210
Testing 201, or: Great Expectations
jmmastey
46
8k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Fireside Chat
paigeccino
41
3.8k
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