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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
SourceGeneratorのススメ
htkym
0
200
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
130
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
140
AtCoder Conference 2025
shindannin
0
1.1k
Raku Raku Notion 20260128
hareyakayuruyaka
0
130
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
300
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
140
並行開発のためのコードレビュー
miyukiw
0
170
Oxlintはいいぞ
yug1224
5
1.3k
2026年 エンジニアリング自己学習法
yumechi
0
140
CSC307 Lecture 02
javiergs
PRO
1
780
Best-Practices-for-Cortex-Analyst-and-AI-Agent
ryotaroikeda
1
110
Featured
See All Featured
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
270
Designing for humans not robots
tammielis
254
26k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
640
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
What's in a price? How to price your products and services
michaelherold
247
13k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
62
50k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
86
Darren the Foodie - Storyboard
khoart
PRO
2
2.4k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
120
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 • これでもちゃんと実行できます