Skip to content

Commit 58158e1

Browse files
author
Charlie Savage
committed
Updated docs and examples.
1 parent 62cb753 commit 58158e1

File tree

9 files changed

+2307
-516
lines changed

9 files changed

+2307
-516
lines changed

doc/created.rid

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Mon, 29 Jul 2019 18:49:49 -0700
1+
Mon, 29 Jul 2019 22:34:12 -0700
22
bin/ruby-prof Mon, 29 Jul 2019 17:38:23 -0700
33
bin/ruby-prof-check-trace Sun, 19 May 2019 23:01:24 -0700
44
lib/ruby-prof.rb Mon, 29 Jul 2019 17:38:23 -0700

doc/js/search_index.js.gz

0 Bytes
Binary file not shown.

examples/primes.call_info.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Thread ID: 21652640
2+
Fiber ID: 50637660
3+
Total Time: 0.35999999998603016
4+
Sort by:
5+
6+
Object#run (tt:0.36, st:0.00, wt:0.00, ct:0.36, call:1, )
7+
Object#run_primes (tt:0.36, st:0.00, wt:0.00, ct:0.36, call:1, )
8+
Object#make_random_array (tt:0.02, st:0.00, wt:0.00, ct:0.02, call:1, )
9+
Class#new (tt:0.00, st:0.00, wt:0.00, ct:0.00, call:1, )
10+
Array#initialize (tt:0.00, st:0.00, wt:0.00, ct:0.00, call:1, )
11+
Array#each_index (tt:0.02, st:0.02, wt:0.00, ct:0.00, call:1, )
12+
Kernel#rand (tt:0.00, st:0.00, wt:0.00, ct:0.00, call:10000, )
13+
Object#find_primes (tt:0.34, st:0.00, wt:0.00, ct:0.34, call:1, )
14+
Array#select (tt:0.34, st:0.00, wt:0.00, ct:0.34, call:1, )
15+
Object#is_prime (tt:0.34, st:0.00, wt:0.00, ct:0.34, call:10000, )
16+
Integer#upto (tt:0.34, st:0.34, wt:0.00, ct:0.00, call:10000, )
17+
Object#find_largest (tt:0.00, st:0.00, wt:0.00, ct:0.00, call:1, )
18+
Array#first (tt:0.00, st:0.00, wt:0.00, ct:0.00, call:1, )
19+
Integer#upto (tt:0.00, st:0.00, wt:0.00, ct:0.00, call:1, )

examples/primes.dot

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
digraph "Profile" {
2+
labelloc=t;
3+
labeljust=l;
4+
subgraph "Thread 21652640" {
5+
44914600 [label="first\n(0%)"];
6+
44914600 -> 44914600 [label="1/1" fontsize=10 fontcolor="#666666"];
7+
44914640 [label="find_largest\n(0%)"];
8+
44914640 -> 44914640 [label="1/1" fontsize=10 fontcolor="#666666"];
9+
44915200 [label="upto\n(96%)"];
10+
44915200 -> 44915200 [label="10000/10001" fontsize=10 fontcolor="#666666"];
11+
44915200 -> 44915200 [label="1/10001" fontsize=10 fontcolor="#666666"];
12+
44915480 [label="is_prime\n(96%)"];
13+
44915480 -> 44915480 [label="10000/10000" fontsize=10 fontcolor="#666666"];
14+
44915780 [label="select\n(96%)"];
15+
44915780 -> 44915780 [label="1/1" fontsize=10 fontcolor="#666666"];
16+
44916640 [label="find_primes\n(96%)"];
17+
44916640 -> 44916640 [label="1/1" fontsize=10 fontcolor="#666666"];
18+
44736600 [label="rand\n(0%)"];
19+
44736600 -> 44736600 [label="10000/10000" fontsize=10 fontcolor="#666666"];
20+
44737520 [label="each_index\n(4%)"];
21+
44737520 -> 44737520 [label="1/1" fontsize=10 fontcolor="#666666"];
22+
44737640 [label="initialize\n(0%)"];
23+
44737640 -> 44737640 [label="1/1" fontsize=10 fontcolor="#666666"];
24+
44737860 [label="new\n(0%)"];
25+
44737860 -> 44737860 [label="1/1" fontsize=10 fontcolor="#666666"];
26+
44737960 [label="make_random_array\n(4%)"];
27+
44737960 -> 44737960 [label="1/1" fontsize=10 fontcolor="#666666"];
28+
44738020 [label="run_primes\n(100%)"];
29+
44738020 -> 44738020 [label="1/1" fontsize=10 fontcolor="#666666"];
30+
44738160 [label="run\n(100%)"];
31+
44738160 -> 44738160 [label="1/1" fontsize=10 fontcolor="#666666"];
32+
}
33+
subgraph cluster_21851040 {
34+
label = "Object";
35+
fontcolor = "#666666";
36+
fontsize = 16;
37+
color = "#666666";
38+
44738160;
39+
44738020;
40+
44737960;
41+
44916640;
42+
44915480;
43+
44914640;
44+
}
45+
subgraph cluster_21850900 {
46+
label = "Class";
47+
fontcolor = "#666666";
48+
fontsize = 16;
49+
color = "#666666";
50+
44737860;
51+
}
52+
subgraph cluster_21839560 {
53+
label = "Array";
54+
fontcolor = "#666666";
55+
fontsize = 16;
56+
color = "#666666";
57+
44737640;
58+
44737520;
59+
44915780;
60+
44914600;
61+
}
62+
subgraph cluster_21850660 {
63+
label = "Kernel";
64+
fontcolor = "#666666";
65+
fontsize = 16;
66+
color = "#666666";
67+
44736600;
68+
}
69+
subgraph cluster_21839800 {
70+
label = "Integer";
71+
fontcolor = "#666666";
72+
fontsize = 16;
73+
color = "#666666";
74+
44915200;
75+
}
76+
}

examples/primes.flat.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Measure Mode: wall_time
2+
Thread ID: 21652640
3+
Fiber ID: 50637660
4+
Total: 0.360000
5+
Sort by: self_time
6+
7+
%self total self wait child calls name location
8+
95.56 0.344 0.344 0.000 0.000 10001 Integer#upto
9+
4.44 0.016 0.016 0.000 0.000 1 Array#each_index
10+
0.00 0.000 0.000 0.000 0.000 1 Array#first
11+
0.00 0.344 0.000 0.000 0.344 10000 Object#is_prime C:/msys64/usr/local/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/ruby-prof-1.0.0-x64-mingw32/test/prime.rb:18
12+
0.00 0.344 0.000 0.000 0.344 1 Array#select
13+
0.00 0.344 0.000 0.000 0.344 1 Object#find_primes C:/msys64/usr/local/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/ruby-prof-1.0.0-x64-mingw32/test/prime.rb:26
14+
0.00 0.000 0.000 0.000 0.000 10000 Kernel#rand
15+
0.00 0.000 0.000 0.000 0.000 1 Object#find_largest C:/msys64/usr/local/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/ruby-prof-1.0.0-x64-mingw32/test/prime.rb:33
16+
0.00 0.000 0.000 0.000 0.000 1 Array#initialize
17+
0.00 0.000 0.000 0.000 0.000 1 Class#new
18+
0.00 0.016 0.000 0.000 0.016 1 Object#make_random_array C:/msys64/usr/local/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/ruby-prof-1.0.0-x64-mingw32/test/prime.rb:9
19+
0.00 0.360 0.000 0.000 0.360 1 Object#run_primes C:/msys64/usr/local/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/ruby-prof-1.0.0-x64-mingw32/test/prime.rb:47
20+
0.00 0.360 0.000 0.000 0.360 1 Object#run C:/msys64/usr/local/src/ruby-prof.github.io/create_examples.rb:27
21+
22+
* recursively called methods
23+
24+
Columns are:
25+
26+
%self - The percentage of time spent in this method, derived from self_time/total_time.
27+
total - The time spent in this method and its children.
28+
self - The time spent in this method.
29+
wait - The amount of time this method waited for other threads.
30+
child - The time spent in this method's children.
31+
calls - The number of times this method was called.
32+
name - The name of the method.
33+
location - The location of the method.
34+
35+
The interpretation of method names is:
36+
37+
* MyObject#test - An instance method "test" of the class "MyObject"
38+
* <Object:MyObject>#test - The <> characters indicate a method on a singleton class.

0 commit comments

Comments
 (0)