手順は上と同様。
インストール
cd <展開したディレクトリ> ruby setup.rb config --prefix=/home/foo ruby setup.rb setup ruby setup.rb install
コピーした www/diary/tdiary/rd_style.rb を編集し、先にインストールした rdtool を読み込めるようにパスを追加する。
# 次の行を require "rd/rdfmt" の前に置く。 $LOAD_PATH << "/home/foo/lib/site_ruby/1.8"
~/www/diary/tdiary.conf を編集し、RD 形式を有効にする。
# デフォルトで以下の行のようになっているのを変更。 #@style = 'tDiary' @style = 'RD'
書いている途中で変更しても、今までのデータには書式情報が付加されているので表示には問題ない。
cogito で使われるツール群。こちらは C で書かれている。さすがに各操作は高速だが、 とりあえずまともに動いているのかさえ確認できてない、だからここにメモ。
まず read-tree/write-tree と commit-tree の関係と、ファイルの履歴、各バージョンの取得、 差分のとりかたを調べないと・・・。
参考:
$ time git-init-db real 0m0.017s user 0m0.001s sys 0m0.015s $ time git-read-tree real 0m0.446s user 0m0.000s sys 0m0.012s $ cat ../git-add-script #!/bin/sh if [ "$1" ]; then git-update-cache --add -- "$@" else find * -type f | xargs git-update-cache --add -- fi $ time ../git-add-script real 0m45.154s user 0m27.406s sys 0m8.127s $ cat ../git-commit-script #!/bin/sh oldheadstr= if [ -s ".git/HEAD" ]; then oldhead=$(cat .git/HEAD) oldheadstr="-p $oldhead" fi treeid=$(git-write-tree) [ "$treeid" ] || exit 1 LOG=$(tempfile) echo "message." >> $LOG newhead=$(git-commit-tree $treeid $oldhead <$LOG) if [ "$newhead" ]; then echo $newhead > .git/HEAD fi rm $LOG $ time ../git-commit-script real 0m0.687s user 0m0.260s sys 0m0.303s # gcc-3.3.2 で上書き。 # 追加ファイルを登録。 $ time ../git-add-script `cat ../add1.txt` real 0m0.835s user 0m0.057s sys 0m0.064s # 削除されたファイルを反映。 $ time git-update-cache --remove `cat ../del1.txt` real 0m0.070s user 0m0.021s sys 0m0.020s # 差分を取得。 $ time git-diff-cache HEAD real 0m2.094s user 0m0.258s sys 0m0.198s # commit。 $ time ../git-commit-script real 0m3.177s user 0m0.136s sys 0m0.454s # gcc-3.3.4 で上書き。 # 追加ファイルを登録。 $ time ../git-add-script `cat ../add2.txt` real 0m1.256s user 0m0.372s sys 0m0.098s # 削除ファイルを反映。 $ time git-update-cache --remove -- `cat ../del2.txt` real 0m1.066s user 0m0.919s sys 0m0.035s # commit。 $ time ../git-commit-script real 0m3.757s user 0m0.088s sys 0m0.389s
$ time monotone commit -m "import." real 2m31.994s user 1m46.258s sys 0m10.883s $ time monotone refresh_inodeprints real 0m26.270s user 0m8.657s sys 0m2.096s # ここで gcc-3.3.2 を上書き $ time monotone drop `cat ../del1.txt` real 0m5.785s user 0m4.702s sys 0m0.109s $ time monotone add --quiet `cat ../add1.txt` real 0m4.834s user 0m4.741s sys 0m0.080s $ time monotone commit -m "3.3.2." real 1m41.633s user 0m46.571s sys 0m5.537s # ここで gcc-3.3.4 を上書き $ time monotone drop `cat ../del2.txt` real 0m1.417s user 0m0.364s sys 0m0.039s $ time monotone add --quiet `cat ../add2.txt` real 0m0.463s user 0m0.411s sys 0m0.030s $ time monotone commit -m "3.3.4." real 1m57.693s user 0m58.459s sys 0m6.300s # ファイル1個を更新して commit。 $ time monotone commit -m "mod." real 0m27.257s user 0m25.393s sys 0m0.526s $ time monotone commit -m "mod." README.SCO real 0m15.017s user 0m13.600s sys 0m0.302s
バージョンに渡る変更だとそれなりに速くなるようだが、 ファイルが少ないとあまり変わりがないようだ。ちなみに Windows の場合は通常の commit に加えて inode index の更新処理が走り、通常よりもはるかに遅くなるため注意。 いまのところ効果がなさそうなので、こっちにメモ書きだけ。