Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
laketowncr
Search
kubo39
August 29, 2015
Programming
390
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
laketowncr
kubo39
August 29, 2015
Transcript
10 slides
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 • これでもちゃんと実行できます
More Decks by kubo39
See All by kubo39
hookingsharedelflibs
kubo39
0
99
Other Decks in Programming
See All in Programming
LLM 101: Exploring LLMs, Starting with Tokens.
dalinaum
0
120
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
450
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
180
How SRE Grew Out of Server-Side Work and Became the Team's Own / サーバサイドから始まったSREを チームに渡すまで
maaaato
1
370
Lean で手続き的プログラム の証明が書けるようになった
inoueasei
11
5.6k
テストだけで見つかる? Rubyでつくるメソッド発掘器
izawa
0
170
Debian JP Projectのサーバー構成
uwabami
1
190
ローカルLLMの基本と近況 2611 / Local LLM basics and recent situation 2611
kishida
3
670
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
620
Going Full Circle with Virtual Graphs and Relational Databases
michaelsimons
1
120
作れるエンジニアから、価値を届けるエンジニアへ
ryunakayama
1
1.3k
あなたはMCPの機能を、まだ知らない。
4geru
1
750
Featured
See All Featured
Prompt Engineering for Job Search
mfonobong
0
610
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
560
A better future with KSS
kneath
240
18k
30 Presentation Tips
portentint
PRO
1
480
How to Talk to Developers About Accessibility
jct
2
630
Reflections from 52 weeks, 52 projects
jeffersonlam
356
22k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.3k
A Modern Web Designer's Workflow
chriscoyier
699
190k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
910
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
エンジニアに許された特別な時間の終わり
watany
109
250k
Navigating Team Friction
lara
192
16k