Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.4.1 - 日本語

Change language to:
English - Français - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Scilab help >> Functions > profiling > profile

profile

Scilab関数の実行プロファイルを展開

呼び出し手順

c=profile(fun)

パラメータ

fun

Scilab関数

c

実行プロファイルを含むnx3 行列

説明

profileを使用するには, Scilab 関数はプロファイル用に設定されている必要があります (exec参照).

このような関数の場合,実行時に 各行の実行回数および各行の実行に要したCPU時間がシステムにより 計測されます. これらのデータは関数データ構造の内部に保存されます. profile関数によりこれらのデータを展開し, cの最初の2列に返すことができます. c の第3列には 対応する行の1回の実行に要したインプリタの負荷の計測値が 出力されます. cの I行目は, 関数の I行目(先頭行を含む)に対応します.

プロセッサクロックの精度(通常はマイクロ秒)により, いくつかの実行された行のCPU時間が, 実際には実行に要したCPU時間の合計が大きい場合でも 0 と表示される可能性があることに 注意してください.

//関数を定義し,プロファイル用に設定
deff('x=foo(n)',['if n==0 then'
                 '  x=[]'
                 'else'
                 '  x=0'
                 '  for k=1:n'
                 '    s=svd(rand(n+10,n+10))'
                 '    x=x+s(1)'
                 '  end'
                 'end'],'p')

//関数をコール
foo(10)

//実行プロファイルを取得
profile(foo)

//関数をコール
foo(20)
profile(foo) //実行プロファイルは蓄積されます

参照

  • exec — スクリプトファイルを実行する
  • deff — 関数のオンライン定義
  • plotprofile — Scilab関数のプロファイルを展開,表示する
  • showprofile — Scilab関数の実行プロファイルを展開し,表示する
Report an issue
<< plotprofile profiling remove_profiling >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Apr 02 17:37:34 CEST 2013