# 左邊執行
$ mkdir git-demo
$ cd git-demo && git init
$ rm -rf .git/hooks/*.sample
# 右邊執行
$ watch -n 1 -d find .
➜ tree .git
.git
├── HEAD
├── config
├── description
├── hooks
├── info
│ └── exclude
├── objects
│ ├── info
│ └── pack
└── refs
├── heads
└── tags
本地配置文件(.git/config)和全局配置文件(~/.gitconfig)
通過執行如下命令,可以將用戶配置記錄到本地代碼倉庫的配置文件中去
git config user.name "demo"
git config user.email "demo@demo.com"
➜ cat .git/config# 均無內容
➜ ll .git/objects
total 0
drwxr-xr-x 2 escape staff 64B Nov 23 20:39 info
drwxr-xr-x 2 escape staff 64B Nov 23 20:39 pack
➜ ll .git/objects/info
➜ ll .git/objects/pack
./.git/hooks/commit-msg.sample
./.git/hooks/pre-rebase.sample
./.git/hooks/pre-commit.sample
./.git/hooks/applypatch-msg.sample
./.git/hooks/fsmonitor-watchman.sample
./.git/hooks/pre-receive.sample
./.git/hooks/prepare-commit-msg.sample
./.git/hooks/post-update.sample
./.git/hooks/pre-merge-commit.sample
./.git/hooks/pre-applypatch.sample
./.git/hooks/pre-push.sample
./.git/hooks/update.sample
➜ cat .git/HEAD
ref: refs/heads/master
# 均無內容
➜ ll .git/refs
total 0
drwxr-xr-x 2 escape staff 64B Nov 23 20:39 heads
drwxr-xr-x 2 escape staff 64B Nov 23 20:39 tags
➜ ll .git/refs/heads
➜ ll .git/refs/tags
➜ cat .git/description
Unnamed repository; edit this file 'description' to name the repository.
性能優化是軟體系統中最有挑戰的工作,非常考驗綜合能力。這麼說吧,如果能把性能優化的各個關鍵點吃透,你已經是個非常厲害的軟體工程師了。
但話說回來,只要你了解少數幾個系統組件的基本原理和協作方式,掌握基本性能指標和工具,和常用的性能優化技巧,已經可以分析和優化大多數性能問題了。在這個基礎上,再去讀那些經典作業系統圖書,才能事半功倍。
我認為,學習要掌握正確的方法。對大多數人來說,最好的學習方式一定是帶著問題、有重點地學習。這裡,分享給你一張 Linux 性能優化圖譜,涵蓋了大部分性能問題,可以幫你建立對系統性能的全面認知。
這張圖譜出自倪朋飛,他是微軟首席軟體開發經理,負責開源容器編排系統 Kubernetes 在 Azure 的落地實踐,之前曾任職於盛大雲和騰訊。哥們在雲計算領域有近 10 年工作經驗,所以對 Linux 性能優化有一套自己的思考和沉澱。
去年,訂閱了他的專欄《Linux 性能優化實戰》,那會兒還是追著更新看的,今年抽空又二刷了。裡面好幾篇文章,都讓我感覺值回了整個專欄的「票價」,已經不能用「收穫大」一言概之了。整個跟下來,是我見過最實用的性能優化學習資料,這裡推薦給你。