<< Assert Development tools example_run >>

Scilabヘルプ >> Development tools > bench_run

bench_run

ベンチマークテストを実行

呼び出し手順

bench_run()
bench_run(module[,test_name[,options]])

引数

module

文字列ベクトル. モジュール名またはツールボックスの絶対パスを指定します.

test_name

文字列ベクトル

options

文字列ベクトル

  • list : モジュールで利用可能なベンチマークテストのリスト

  • help : Scilabコンソールにいくつかの使用例を表示

  • nb_run=value : ベンチマークテストを指定回数反復実行

説明

ベンチマークテストライブラリの .tst ファイルを探して実行し,実行時間に関する レポートを表示します. .tst ファイルはSCI+"/modules/*/tests/benchmark"ディレクトリで探されます.

テスト処理を制御しやすくするために,.tstファイルに特殊なタグを挿入できます. これらのタグはScilabコメントとして記入します.

利用可能なタグを以下に示します :

bench_runを実行例をいくつか示します

// 全てのテストを実行
bench_run();
bench_run([]);
bench_run([],[]);
// 1つまたは複数のモジュールをテスト
bench_run('core');
bench_run('core',[]);
bench_run(['core','string']);
// 指定したモジュールの1つまたは複数のテストを実行
bench_run('core',['trycatch','opcode']);
// オプションを指定
bench_run([],[],'list');
bench_run([],[],'help');
bench_run([],[],'nb_run=2000');

ベンチマークファイルの例. このファイルはファイル SCI/modules/linear_algebra/tests/benchmarks/bench_chol.tstに対応します.

// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2007-2008 - INRIA
//
//  This file is distributed under the same license as the Scilab package.
// =============================================================================
//==============================================================================
// Benchmark for chol function
//==============================================================================
// <-- BENCH NB RUN : 10 -->
stacksize(30000000);
a = 0;
b = 0;
a = rand(900, 900, 'n');
a = a'*a;
// <-- BENCH START -->
b = chol(a);
// <-- BENCH END -->

テストの結果

-->bench_run('linear_algebra','bench_chol')
           For Loop (as reference) ...........................      143.00 ms [ 1000000 x]
  001/001 - [linear_algebra] bench_chol ......................      130.60 ms [      10 x]

参照


Report an issue
<< Assert Development tools example_run >>