Skip to content
This repository has been archived by the owner on Apr 13, 2020. It is now read-only.

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rosylilly committed Apr 2, 2017
1 parent b81aa12 commit c838e73
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ end

AUTHORS.each do |author|
file "#{author}/README.txt" => ["#{author}/README.md"] do |t|
sh "md2inao.pl --format=in_design #{t.source} | sed -e '1d' > #{t.name}"
sh "md2inao.pl --format=in_design #{t.source} | sed -e '1d' | sed -e 's/ParaStyle:タイトル>タイトル:/ParaStyle:タイトル>/' > #{t.name}"
end
end
16 changes: 0 additions & 16 deletions at_grandpa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ Title: Crystalを計測するためのあれこれ
Author: Yoshiyuki Tsuchida
Twitter: @at_grandpa

# Crystalを計測するためのあれこれ

こんにちは、@at_grandpaです。今回はCrystalについての本ということで、「Crystalを計測するためのあれこれ」について書かせていただきます。計測に詳しい方々からは「Crystalに限った内容ではない!」とツッコミをいただきそうですが、そうです、Crystalに限ったことではないのです(すみません)。ではなぜCrystalの本にこれを掲載するかというと、Crystalは現状、

* 「Rubyの代替」というイメージが(今なお)強い
Expand All @@ -13,20 +11,6 @@ Twitter: @at_grandpa

と言いますか、「自分が気になって調べたことをここに記載した」というのが本音です。「原稿を書く」という経験がなく、見積もりを誤った結果、ギリギリで執筆しているというのが現状です。心中お察しくださいませ。

# 目次

* はじめに
* Crystalを実行するための準備
* timeコマンド
* Benchmarkクラス
* Benchmark#bm
* Benchmark#ips
* ApacheBench
* gperftools
* CPU PROFILER
* HEAP PROFILER
* まとめ

# はじめに

はじめに、今回の内容について共有しておくべきことを書きます。
Expand Down
20 changes: 10 additions & 10 deletions makenowjust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ macros/ tools/ config.cr formatter.cr semantic.cr util.cr

これらのファイルやディレクトリのうち、重要なものをいくつか紹介します。

- `command.cr``Crystal::Command`クラスが定義されています。このクラスは`crystal`コマンドの実質的なエントリポイントです。(本当のエントリポイントは`/src/compiler/crystal.cr`ですが、このファイルは実質的に`Crystal::Command.run`を呼んでいるだけです)
- `command/`: `crystal`コマンドの一部のサブコマンド(`crystal tool format``crystal spec`など)のエントリポイントがこのディレクトリ以下にあります。
- `tools/`: `crystal tool format``crystal init``crystal play`などのサブコマンドの実装がこのディレクトリ以下にあります。
- `compiler.cr`: `Crystal::Compiler`クラスが定義されています。このクラスはソースコードをパースして抽象構文木を作り、それに各種処理を適用して最終的に実行ファイルを作るまでの一連の処理をまとめています。
- `program.cr`: `Crystal::Program`クラスが定義されています。このクラスはプログラムの環境を表わしていて、トップレベルのクラスやメソッドの定義を保持しています。このクラスのインスタンスは様々なところで使い回されることになります。
- `types.cr`: 型を表すクラスが定義されています。
- `syntax/`: パーサーの実装や抽象構文木の定義がこのディレクトリ以下にあります。
- `semantic.cr`, `semantic/`: `Semantic`フェーズの各処理の実装がここにあります。
- `codegen.cr`, `codegen/`: `Codegen`フェーズの各処理の実装がここにあります。
- `command.cr``Crystal::Command`クラスが定義されています。このクラスは`crystal`コマンドの実質的なエントリポイントです。(本当のエントリポイントは`/src/compiler/crystal.cr`ですが、このファイルは実質的に`Crystal::Command.run`を呼んでいるだけです)
- `command/`: `crystal`コマンドの一部のサブコマンド(`crystal tool format``crystal spec`など)のエントリポイントがこのディレクトリ以下にあります。
- `tools/`: `crystal tool format``crystal init``crystal play`などのサブコマンドの実装がこのディレクトリ以下にあります。
- `compiler.cr`: `Crystal::Compiler`クラスが定義されています。このクラスはソースコードをパースして抽象構文木を作り、それに各種処理を適用して最終的に実行ファイルを作るまでの一連の処理をまとめています。
- `program.cr`: `Crystal::Program`クラスが定義されています。このクラスはプログラムの環境を表わしていて、トップレベルのクラスやメソッドの定義を保持しています。このクラスのインスタンスは様々なところで使い回されることになります。
- `types.cr`: 型を表すクラスが定義されています。
- `syntax/`: パーサーの実装や抽象構文木の定義がこのディレクトリ以下にあります。
- `semantic.cr`, `semantic/`: `Semantic`フェーズの各処理の実装がここにあります。
- `codegen.cr`, `codegen/`: `Codegen`フェーズの各処理の実装がここにあります。

ここにあるファイルを弄っていくことで、コンパイラを改造していきます。

Expand All @@ -97,8 +97,8 @@ macros/ tools/ config.cr formatter.cr semantic.cr util.cr
依存ライブラリをインストールしたら、`make`コマンドを叩いてビルドを実行するだけです。また、ビルドしてできたファイルを削除したい場合は`make clean`を実行します。また、コンパイラのテストをするには`make compiler_spec`、標準ライブラリのテストをするには`make std_spec`を実行します。(`make spec`も存在しますが、膨大なメモリと実行時間を必要とするので注意してください。)

```
●図1::Crystalのmake
!!!cmd
●図1::Crystalのmake
(注:コンパイラをビルドする)
$ make
(注:ビルドしてできたファイルを削除する)
Expand Down

0 comments on commit c838e73

Please sign in to comment.