クラス
-
Benchmark
:: Tms (36) -
Zlib
:: ZStream (24)
モジュール
- Benchmark (60)
- GC (24)
-
GC
:: Profiler (48) - ObjectSpace (84)
キーワード
- FORMAT (24)
-
NEWS for Ruby 3
. 1 . 0 (4) -
Profiler
_ _ (6) - benchmark (12)
- bm (12)
- bmbm (12)
-
count
_ objects (12) -
count
_ objects _ size (12) -
each
_ object (48) - format (12)
- measure (12)
-
memsize
_ of _ all (12) - profile (6)
-
raw
_ data (12) - report (12)
- result (12)
- stat (24)
-
total
_ in (12) -
total
_ out (12) -
total
_ time (12)
検索結果
先頭5件
-
Benchmark
:: Tms # total -> Float (18101.0) -
合計時間。(utime + stime + cutime + cstime)
合計時間。(utime + stime + cutime + cstime) -
GC
:: Profiler . total _ time -> Float (6107.0) -
GC のプロファイル情報から GC の総計時間を計算し、msec 単位で返します。
...GC のプロファイル情報から GC の総計時間を計算し、msec 単位で返します。
//emlist[例][ruby]{
GC::Profiler.enable
GC.start
GC::Profiler.total_time # => 0.0011530000000000012
//}... -
Zlib
:: ZStream # total _ in -> Integer (6101.0) -
ストリームに入力されたデータの総バイト数を返します。
ストリームに入力されたデータの総バイト数を返します。 -
Zlib
:: ZStream # total _ out -> Integer (6101.0) -
ストリームの出力したデータの総バイト数を返します。
ストリームの出力したデータの総バイト数を返します。 -
Benchmark
. # benchmark(caption = "" , label _ width = nil , fmtstr = nil , *labels) {|rep| . . . } -> [Benchmark :: Tms] (36.0) -
Benchmark::Report オブジェクトを生成し、それを引数として与えられたブロックを実行します。
...hmark::Tms#cutime
: %Y
子プロセスの system CPU time で置き換えられます。Benchmark::Tms#cstime
: %t
total CPU time で置き換えられます。Benchmark::Tms#total
: %r
実経過時間で置き換えられます。Benchmark::Tms#real
: %n
ラベルで置き換えられます......'benchmark'
n = 50000
# これは
# Benchmark.bm(7, ">total:", ">avg:") do |x| ... end
# と同じ
Benchmark.benchmark(" "*7 + Benchmark::CAPTION,
7,
Benchmark::FORMAT,
">total:",
">avg:") do |x|
tf = x.report("f......+tt+tu)/3]
end
#=>
#
# user system total real
# for: 1.016667 0.016667 1.033333 ( 0.485749)
# times: 1.450000 0.016667 1.466667 ( 0.681367)
# upto: 1.533333 0.000000 1.533333 ( 0.722166)
# >total: 4.000000 0.033333 4.033333 ( 1.889282)
# >a... -
Benchmark
. # bm(label _ width = 0 , *labels) {|rep| . . . } -> [Benchmark :: Tms] (30.0) -
Benchmark.#benchmark メソッドの引数を簡略化したものです。
...i in 1..n; a = "1"; end }
x.report { n.times do ; a = "1"; end }
x.report { 1.upto(n) do ; a = "1"; end }
end
#=>
#
# user system total real
# 1.033333 0.016667 1.016667 ( 0.492106)
# 1.483333 0.000000 1.483333 ( 0.694605)
# 1.516667 0.000000 1.516667 ( 0.7......stem total real
# for: 1.050000 0.000000 1.050000 ( 0.503462)
# times: 1.533333 0.016667 1.550000 ( 0.735473)
# upto: 1.500000 0.016667 1.516667 ( 0.711239)
//}
集計を付けた場合
//emlist[][ruby]{
require 'benchmark'
n = 50000
Benchmark.bm(7, ">total:",......tu) / 3]
end
#=>
# user system total real
# for: 0.001467 0.004727 0.006194 ( 0.006193)
# times: 0.003814 0.000000 0.003814 ( 0.003814)
# upto: 0.003855 0.000003 0.003858 ( 0.003859)
# >total: 0.009136 0.004730 0.013866 ( 0.013867)
#... -
GC
. stat(key) -> Numeric (24.0) -
GC 内部の統計情報を Hash で返します。
...ed_slots=>0,
:heap_swept_slots=>0,
:heap_eden_pages=>24,
:heap_tomb_pages=>0,
:total_allocated_pages=>24,
:total_freed_pages=>0,
:total_allocated_objects=>7796,
:total_freed_objects=>83,
:malloc_increase_bytes=>2389312,
:malloc_increase_bytes_limit=>16777... -
GC
. stat(result _ hash = {}) -> {Symbol => Integer} (24.0) -
GC 内部の統計情報を Hash で返します。
...ed_slots=>0,
:heap_swept_slots=>0,
:heap_eden_pages=>24,
:heap_tomb_pages=>0,
:total_allocated_pages=>24,
:total_freed_pages=>0,
:total_allocated_objects=>7796,
:total_freed_objects=>83,
:malloc_increase_bytes=>2389312,
:malloc_increase_bytes_limit=>16777... -
GC
:: Profiler . raw _ data -> [Hash , . . . ] | nil (24.0) -
GC のプロファイル情報を GC の発生ごとに Hash の配列 (:GC_INVOKE_TIME が早いもの順)で返します。GC::Profiler が有効になっ ていない場合は nil を返します。
...:GC_TIME=>1.3000000000000858e-05,
:GC_INVOKE_TIME=>0.010634999999999999,
:HEAP_USE_SIZE=>289640,
:HEAP_TOTAL_SIZE=>588960,
:HEAP_TOTAL_OBJECTS=>14724,
:GC_IS_MARKED=>false
},
# ...
]
各項目の意味を以下に示します。
: :GC_TIME
GC......動するまでに経過した時間(秒)
: :HEAP_USE_SIZE
ヒープ内での使用サイズ(バイト)
: :HEAP_TOTAL_SIZE
ヒープ全体のサイズ(バイト)
: :HEAP_TOTAL_OBJECTS
ヒープ内に存在するオブジェクトの個数
: :GC_IS_MARKED
GC がマークフェイズ...