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
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
AI & Enginnering
codelynx
0
110
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
Fragmented Architectures
denyspoltorak
0
160
ぼくの開発環境2026
yuzneri
0
230
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
130
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
21
7.2k
Basic Architectures
denyspoltorak
0
670
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
280
Apache Iceberg V3 and migration to V3
tomtanaka
0
160
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
7
3.9k
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1k
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
170
Featured
See All Featured
Designing Powerful Visuals for Engaging Learning
tmiket
0
230
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
The untapped power of vector embeddings
frankvandijk
1
1.6k
Designing Experiences People Love
moore
144
24k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
290
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
120
Code Reviewing Like a Champion
maltzj
527
40k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
180
The Cost Of JavaScript in 2023
addyosmani
55
9.5k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
180
The Limits of Empathy - UXLibs8
cassininazir
1
210
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 • これでもちゃんと実行できます