1 / 9

An empirical comparison of C, C++, Java, Perl, Python, Rexx, and Tcl

An empirical comparison of C, C++, Java, Perl, Python, Rexx, and Tcl. sada@ecn. Introduction. 7 つのプログラミング言語で同じ処理をするプログラムを書いてもらうテスト 複数の人が実験台に プログラムの種類 Z1000:1000 個の電話番号をランダムに生成 M1000:1000 個の任意の電話番号(空を含む) Z0: 電話番号を生成しない(初期化処理測定用) 電話番号をアルファベットに変換し辞書から検索. Results – Run time. 初期化処理 (z0)

Download Presentation

An empirical comparison of C, C++, Java, Perl, Python, Rexx, and Tcl

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. An empirical comparison of C, C++, Java, Perl, Python, Rexx, and Tcl sada@ecn

  2. Introduction • 7つのプログラミング言語で同じ処理をするプログラムを書いてもらうテスト • 複数の人が実験台に • プログラムの種類 • Z1000:1000個の電話番号をランダムに生成 • M1000:1000個の任意の電話番号(空を含む) • Z0:電話番号を生成しない(初期化処理測定用) • 電話番号をアルファベットに変換し辞書から検索

  3. Results – Run time • 初期化処理(z0) • C, C++は速い • スクリプトではPerl, Pythonが速い • サーチ処理(z1000) • Rexx, Tclだけやたら遅い

  4. Results – Memory consumption • メモリ消費量はC, C++が最も少ない • Javaが最も多い • スクリプト言語は意外にメモリを食わない

  5. Results – Program length and amount of commenting • スクリプト言語はプログラム行数が短くて済む • そのせいか、プログラム中に含まれるコメントの比率が高い

  6. Results – Program reliability • Z1000テスト • C, C++, Perlが正しくない答え • Javaがクラッシュ • M1000テスト • JavaとTclとPythonでクラッシュしたのが出た • ・・・これはプログラムが変なのでは?

  7. Results – Work time and productivity • コーディングにかかる時間はスクリプト系がやはり短くて済む • LOC/hour (Line Of Code) • Tclで時間がかかり気味の人がいる

  8. Results – Program structure • スクリプト系の場合 • 電話番号をキーにして、データを連想配列に • サーチの処理は連想配列を使って簡単に記述できる • 非スクリプト系の場合 • 配列に入れる • データ構造をツリー状にする、という手もある • サーチの処理は自前で書かなければいけない • C++, Javaはハッシュテーブルのクラスが用意されているのに、使わない人が多い

  9. Conclusion

More Related