Ceph編譯加速的小技巧

2022-06-15 09:24:14 字數 2367 閱讀 7734

總結了幾個小技巧,用於在ceph編譯過程中,能夠更快一點

git clone

可以修改成

git clone git:

某些時候可能可以加快一些

假如現在想看10.2.5版本的**

git clone git: all
counting objects: 460384

這個是包含所有的分支和分支內的檔案的所有版本的

我們切換到分支

[root@lab8106 mytest]#cd all

[root@lab8106 all]# git branch

* master

[root@lab8106 all]# git checkout -b all10.2.5 v10.2.5

switched to a new branch 'all10.2.5'

[root@lab8106 all]# git branch

* all10.2.5

master

[root@lab8106 all]# ls -r|wc -l

4392

可以看到有這麼多的檔案

[root@lab8106 mytest]# git clone -b v10.2.5 --single-branch   git: single
counting objects: 344026

[root@lab8106 mytest]# cd single/

[root@lab8106 single]# git checkout -b single10.2.5

switched to a new branch 'single10.2.5'

[root@lab8106 single]# git branch

* single10.2.5

[root@lab8106 single]# ls -r |wc -l

4392

[root@lab8106 mytest]# git clone -b v10.2.5 --single-branch --depth 1  git: singledep1
counting objects: 3682

[root@lab8106 mytest]#  cd singledep1/

[root@lab8106 singledep1]# git checkout -b singledep110.2.5

switched to a new branch 'singledep110.2.5'

[root@lab8106 singledep1]# git branch

* singledep110.2.5

[root@lab8106 singledep1]# ls -r |wc -l

4392

從上面的可以看到三個版本的**是一致的,那麼區別在**

提前準備好epel

yum install 

rm -rf /etc/yum.repos.d/epel*

裝完了刪除,這個是為了繞過包驗證

wget -o /etc/yum.repos.d/epel.repo
刪除慢速的 aliyuncs

sed -i '/aliyuncs/d' /etc/yum.repos.d/epel.repo
install-deps.sh第72行的需要修改

yum-config-manager --add-repo

執行下面的命令

sed -i 's/https:\/\/dl.fedoraproject.org\/pub\//http:\/\/mirrors.aliyun.com\//g' install-deps.sh
然後執行install-deps.sh,這樣會快很多的

目前就這麼多,後續有更多的影響速度的地方會增加上去

如何加速Linux下的編譯速度(加速make)

專案越來越大,每次需要重新編譯整個專案都是一件很浪費時間的事情。research了一下,找到以下可以幫助提高速度的方法,總結一下。有人說在windows下用了ramdisk把乙個專案編譯時間從4.5小時減少到了5分鐘,也許這個數字是有點誇張了,不過粗想想,把檔案放到記憶體上做編譯應該是比在磁碟上快多...

Python的冷技巧小技巧

記得剛開始工作的時候,老大給我們上 c 基礎課,告訴我們字串字面量可以換行 如下 感覺真是如夢如幻。python view plain copy include int main int argc,char argv 輸出 plain view plain copy hello world.後來在寫...

boost shared ptr的小技巧

這段 有兩個奇妙之處 1.a的析構函式是protected,編譯時並沒有錯誤提示 2.a的析構函式不是virtual的,但最後b的析構函式卻被呼叫了 shared ptr真是讓人眼前一亮,那就到boost的裡面來探一 竟吧 先從shared ptr的申明開始 注意到這裡有兩個變數,px,pn,來看看...