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
laketowncr
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
kubo39
August 29, 2015
Programming
0
360
laketowncr
kubo39
August 29, 2015
Tweet
Share
More Decks by kubo39
See All by kubo39
hookingsharedelflibs
kubo39
0
88
Other Decks in Programming
See All in Programming
Oxlintはいいぞ
yug1224
5
1.3k
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
120
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
4
680
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
390
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
140
CSC307 Lecture 05
javiergs
PRO
0
500
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.8k
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
170
Fragmented Architectures
denyspoltorak
0
150
20260127_試行錯誤の結晶を1冊に。著者が解説 先輩データサイエンティストからの指南書 / author's_commentary_ds_instructions_guide
nash_efp
1
970
2026年 エンジニアリング自己学習法
yumechi
0
130
Featured
See All Featured
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
61
52k
30 Presentation Tips
portentint
PRO
1
220
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
66
Into the Great Unknown - MozCon
thekraken
40
2.3k
Marketing to machines
jonoalderson
1
4.6k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
120
How to train your dragon (web standard)
notwaldorf
97
6.5k
The SEO Collaboration Effect
kristinabergwall1
0
350
SEO for Brand Visibility & Recognition
aleyda
0
4.2k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
65
Transcript
Laketowncr kubo39
Crystal binary size 619KB to 704bytes • Repo: https://github.com/kubo39/tinycr
619KB → 528KB • --release build 632962bytes →540050bytes
528KB → 454KB • Use strip command 540050bytes → 463944bytes
454KB → 10592bytes • --prelude=empty prelude.crではなくemtpy.crをロードする 必要なライブラリは適宜自前でrequire • https://github.com/kubo39/tinycr/commit/c0d 2e519902fa7a9cee57a004acda656f3e10e8f
- libpcre依存とか消せる - この時点でインラインアセンブラ書いたりしてるが あまり意味ない
10592bytes → 6272bytes • to_unsafe Stringクラスのunsafeを自前で定義しなおす • https://github.com/kubo39/tinycr/commit/63d 5c8be5eabdf268509053aef8525064afb3eeb •
この時点でlibc以外の依存がなくなった
6272bytes →5480bytes • eglibc捨ててmusl libcに静的リンク • https://github.com/kubo39/tinycr/commit/973 284df2cd59e25245858cc79c38e3097770f6b • とうとう依存がなくなった!!
ldd helloでも確認
5480bytes → 5400bytes • --gc-sections - リンク時に不要なセクション削除 • https://github.com/kubo39/tinycr/commit/d4c 568bda484c1b7c1a9a35f02b08a4cad7fc15c
5400bytes → 5360bytes • エントリポイントをmainにする 普通にやるとsegvるのでexit(2)で終了 • https://github.com/kubo39/tinycr/commit/afcc 7aca613ce59b171b6850f1f4e130fba6e44c
5360bytes →704bytes • というかもうlibc依存する処理一切ないよね、という わけで--nostdlib渡す • https://github.com/kubo39/tinycr/commit/e2b 77fe1855aa36579459bb8f5096eae93eed4ca • これでもちゃんと実行できます