ruby-prof 0.11.0.rc3-x86-mingw32 → 0.11.2-x86-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +28 -0
- data/Rakefile +1 -0
- data/bin/ruby-prof +57 -0
- data/ext/ruby_prof/rp_measure_allocations.c +9 -30
- data/ext/ruby_prof/rp_measure_gc_runs.c +11 -33
- data/ext/ruby_prof/rp_measure_gc_time.c +7 -19
- data/ext/ruby_prof/rp_measure_memory.c +20 -27
- data/ext/ruby_prof/rp_stack.c +17 -1
- data/ext/ruby_prof/rp_stack.h +8 -0
- data/ext/ruby_prof/ruby_prof.c +79 -16
- data/ext/ruby_prof/ruby_prof.h +2 -0
- data/ext/ruby_prof/vc/ruby_prof_18.vcxproj +3 -0
- data/ext/ruby_prof/version.h +2 -2
- data/lib/1.8/ruby_prof.so +0 -0
- data/lib/1.9/ruby_prof.so +0 -0
- data/lib/ruby-prof/compatibility.rb +43 -23
- data/lib/ruby-prof/printers/flat_printer.rb +1 -1
- data/lib/ruby-prof/printers/graph_html_printer.rb +1 -1
- data/lib/ruby-prof/printers/graph_printer.rb +1 -1
- data/ruby-prof.gemspec +1 -2
- data/test/basic_test.rb +55 -1
- data/test/line_number_test.rb +4 -6
- data/test/measure_cpu_time_test.rb +0 -3
- data/test/multi_printer_test.rb +0 -1
- data/test/pause_resume_test.rb +61 -0
- data/test/pause_test.rb +57 -0
- data/test/prime.rb +1 -1
- data/test/prime_test.rb +1 -1
- data/test/recursive_test.rb +9 -11
- data/test/test_suite.rb +2 -2
- data/test/thread_test.rb +5 -5
- data/test/unique_call_path_test.rb +0 -1
- metadata +8 -7
- data/test/summarize_test.rb +0 -48
data/test/prime.rb
CHANGED
data/test/prime_test.rb
CHANGED
data/test/recursive_test.rb
CHANGED
@@ -50,9 +50,10 @@ class RecursiveTest < Test::Unit::TestCase
|
|
50
50
|
method.full_name.match(/Fixnum/)
|
51
51
|
end
|
52
52
|
|
53
|
-
assert_equal(3, methods.length)
|
53
|
+
assert_equal(3, methods.length)
|
54
54
|
|
55
55
|
# Method 0: RecursiveTest#test_simple
|
56
|
+
methods.sort!.reverse!
|
56
57
|
method = methods[0]
|
57
58
|
assert_equal('RecursiveTest#test_simple', method.full_name)
|
58
59
|
assert_equal(1, method.called)
|
@@ -79,16 +80,12 @@ class RecursiveTest < Test::Unit::TestCase
|
|
79
80
|
assert_equal(2, method.call_infos.length)
|
80
81
|
|
81
82
|
call_info = method.call_infos.first
|
82
|
-
|
83
|
-
assert_equal(4, call_info.children.length)
|
84
|
-
else
|
85
|
-
assert_equal(2, call_info.children.length)
|
86
|
-
end
|
83
|
+
assert_equal(2 + (RUBY_VERSION < '1.9.0' ? 2 : 0), call_info.children.length)
|
87
84
|
assert_equal('RecursiveTest#test_simple->Object#simple', call_info.call_sequence)
|
88
85
|
assert(!call_info.recursive)
|
89
86
|
|
90
87
|
call_info = method.call_infos.last
|
91
|
-
assert_equal(1, call_info.children.length)
|
88
|
+
assert_equal(1 + (RUBY_VERSION < '1.9.0' ? 2 : 0), call_info.children.length)
|
92
89
|
assert_equal('RecursiveTest#test_simple->Object#simple->Object#simple', call_info.call_sequence)
|
93
90
|
assert(call_info.recursive)
|
94
91
|
|
@@ -112,6 +109,7 @@ class RecursiveTest < Test::Unit::TestCase
|
|
112
109
|
assert(!call_info.recursive)
|
113
110
|
|
114
111
|
if RUBY_VERSION < '1.9'
|
112
|
+
methods = result.threads.first.methods.dup.sort!.reverse!
|
115
113
|
method = methods[3]
|
116
114
|
assert_equal('Fixnum#-', method.full_name)
|
117
115
|
assert_equal(2, method.called)
|
@@ -207,7 +205,7 @@ class RecursiveTest < Test::Unit::TestCase
|
|
207
205
|
|
208
206
|
call_info = method.call_infos[1]
|
209
207
|
assert_equal('RecursiveTest#test_cycle->Object#render->Integer#times->Object#render_partial->Integer#times', call_info.call_sequence)
|
210
|
-
assert_equal(1, call_info.children.length)
|
208
|
+
assert_equal(1 + (RUBY_VERSION < '1.9.0' ? 1 : 0), call_info.children.length)
|
211
209
|
assert(call_info.recursive)
|
212
210
|
|
213
211
|
method = methods[3]
|
@@ -221,17 +219,17 @@ class RecursiveTest < Test::Unit::TestCase
|
|
221
219
|
assert_equal(3, method.call_infos.length)
|
222
220
|
call_info = method.call_infos[0]
|
223
221
|
assert_equal('RecursiveTest#test_cycle->Object#render->Integer#times->Object#render_partial', call_info.call_sequence)
|
224
|
-
assert_equal(3, call_info.children.length)
|
222
|
+
assert_equal(3 + (RUBY_VERSION < '1.9.0' ? 1 : 0), call_info.children.length)
|
225
223
|
assert(!call_info.recursive)
|
226
224
|
|
227
225
|
call_info = method.call_infos[1]
|
228
226
|
assert_equal('RecursiveTest#test_cycle->Object#render->Integer#times->Object#render_partial->Object#render_partial', call_info.call_sequence)
|
229
|
-
assert_equal(1, call_info.children.length)
|
227
|
+
assert_equal(1 + (RUBY_VERSION < '1.9.0' ? 1 : 0), call_info.children.length)
|
230
228
|
assert(call_info.recursive)
|
231
229
|
|
232
230
|
call_info = method.call_infos[2]
|
233
231
|
assert_equal('RecursiveTest#test_cycle->Object#render->Integer#times->Object#render_partial->Integer#times->Object#render_partial', call_info.call_sequence)
|
234
|
-
assert_equal(1, call_info.children.length)
|
232
|
+
assert_equal(1 + (RUBY_VERSION < '1.9.0' ? 1 : 0), call_info.children.length)
|
235
233
|
assert(call_info.recursive)
|
236
234
|
|
237
235
|
method = methods[4]
|
data/test/test_suite.rb
CHANGED
@@ -24,6 +24,7 @@ require File.expand_path("../test_helper", __FILE__)
|
|
24
24
|
module_test
|
25
25
|
multi_printer_test
|
26
26
|
no_method_class_test
|
27
|
+
pause_test
|
27
28
|
prime_test
|
28
29
|
printers_test
|
29
30
|
recursive_test
|
@@ -34,5 +35,4 @@ require File.expand_path("../test_helper", __FILE__)
|
|
34
35
|
thread_test
|
35
36
|
unique_call_path_test).each do |test|
|
36
37
|
require File.expand_path("../#{test}", __FILE__)
|
37
|
-
end
|
38
|
-
|
38
|
+
end
|
data/test/thread_test.rb
CHANGED
@@ -25,14 +25,14 @@ class ThreadTest < Test::Unit::TestCase
|
|
25
25
|
|
26
26
|
def test_thread_identity
|
27
27
|
RubyProf.start
|
28
|
-
|
28
|
+
sleep_thread = Thread.new do
|
29
29
|
sleep(1)
|
30
30
|
end
|
31
|
-
|
31
|
+
sleep_thread.join
|
32
32
|
result = RubyProf.stop
|
33
33
|
|
34
34
|
thread_ids = result.threads.map {|thread| thread.id}.sort
|
35
|
-
threads = [Thread.current,
|
35
|
+
threads = [Thread.current, sleep_thread]
|
36
36
|
assert_equal(2, result.threads.length)
|
37
37
|
|
38
38
|
assert(thread_ids.include?(threads[0].object_id))
|
@@ -164,9 +164,9 @@ class ThreadTest < Test::Unit::TestCase
|
|
164
164
|
end
|
165
165
|
|
166
166
|
def test_thread
|
167
|
-
|
167
|
+
RubyProf.profile do
|
168
168
|
begin
|
169
|
-
|
169
|
+
Timeout::timeout(2) do
|
170
170
|
while true
|
171
171
|
next
|
172
172
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-prof
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
5
|
-
prerelease:
|
4
|
+
version: 0.11.2
|
5
|
+
prerelease:
|
6
6
|
platform: x86-mingw32
|
7
7
|
authors:
|
8
8
|
- Shugo Maeda, Charlie Savage, Roger Pack, Stefan Kaes
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake-compiler
|
@@ -136,6 +136,8 @@ files:
|
|
136
136
|
- test/module_test.rb
|
137
137
|
- test/multi_printer_test.rb
|
138
138
|
- test/no_method_class_test.rb
|
139
|
+
- test/pause_resume_test.rb
|
140
|
+
- test/pause_test.rb
|
139
141
|
- test/prime.rb
|
140
142
|
- test/prime_test.rb
|
141
143
|
- test/printers_test.rb
|
@@ -144,7 +146,6 @@ files:
|
|
144
146
|
- test/stack_printer_test.rb
|
145
147
|
- test/stack_test.rb
|
146
148
|
- test/start_stop_test.rb
|
147
|
-
- test/summarize_test.rb
|
148
149
|
- test/test_helper.rb
|
149
150
|
- test/test_suite.rb
|
150
151
|
- test/thread_test.rb
|
@@ -166,12 +167,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
166
167
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
168
|
none: false
|
168
169
|
requirements:
|
169
|
-
- - ! '
|
170
|
+
- - ! '>='
|
170
171
|
- !ruby/object:Gem::Version
|
171
|
-
version:
|
172
|
+
version: '0'
|
172
173
|
requirements: []
|
173
174
|
rubyforge_project:
|
174
|
-
rubygems_version: 1.8.
|
175
|
+
rubygems_version: 1.8.24
|
175
176
|
signing_key:
|
176
177
|
specification_version: 3
|
177
178
|
summary: Fast Ruby profiler
|
data/test/summarize_test.rb
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# encoding: UTF-8
|
3
|
-
|
4
|
-
require File.expand_path('../test_helper', __FILE__)
|
5
|
-
|
6
|
-
def slow
|
7
|
-
sleep(3)
|
8
|
-
end
|
9
|
-
|
10
|
-
def fast
|
11
|
-
sleep(3)
|
12
|
-
end
|
13
|
-
|
14
|
-
def slow_caller
|
15
|
-
1.times do
|
16
|
-
slow
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
def fast_caller
|
21
|
-
1.times do
|
22
|
-
fast
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def parent
|
27
|
-
[1..10].each do
|
28
|
-
#slow_caller
|
29
|
-
fast_caller
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
class SummarizeTest < Test::Unit::TestCase
|
34
|
-
def setup
|
35
|
-
# Need to use wall time for this test due to the sleep calls
|
36
|
-
RubyProf::measure_mode = RubyProf::WALL_TIME
|
37
|
-
end
|
38
|
-
|
39
|
-
def test
|
40
|
-
result = RubyProf::Profile.profile do
|
41
|
-
parent
|
42
|
-
end
|
43
|
-
|
44
|
-
printer = RubyProf::GraphPrinter.new(result)
|
45
|
-
printer.print(STDOUT)
|
46
|
-
|
47
|
-
end
|
48
|
-
end
|