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
380
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
laketowncr
kubo39
August 29, 2015
More Decks by kubo39
See All by kubo39
hookingsharedelflibs
kubo39
0
96
Other Decks in Programming
See All in Programming
AHC070解法紹介
eijirou
0
150
Heart of Swift Concurrency
koher
0
1.2k
Simple Storage Service(S3) is not simple
iwatsukayura
0
120
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
380
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.4k
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
130
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
690
SONY CISC-NEWS NWS-1750 + NWB-225 フレームバッファの NetBSD/news68k ドライバ実装 / OSC2026Hiroshima
tsutsui
0
170
Java 27新機能 / Java 27 new features
kishida
2
190
Rでドレミ/Do-Re-Mi_with_R
florets1
0
110
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
220
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
330
Featured
See All Featured
Prompt Engineering for Job Search
mfonobong
0
470
Marketing to machines
jonoalderson
1
5.8k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
How to Talk to Developers About Accessibility
jct
2
560
Amusing Abliteration
ianozsvald
1
320
Why Our Code Smells
bkeepers
PRO
340
58k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
3
4.3k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
440
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Producing Creativity
orderedlist
PRO
348
41k
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 • これでもちゃんと実行できます