ruby-prof on windows: strange measured time numbers

Z

Zhoran Tvalve

Hi there,
I play with ruby-prof. Profiling those simple-few-dozens-line scripts
seems clear, but when I try to profile `rake --tasks`, as follows

C:\InstantRails\rails_apps\projectN>"ruby-prof" "--printer=graph_html"
"--file=ruby_prof.rake.html" "--min_percent=1.00" "--"
"C:\InstantRails\ruby\bin\rake" --tasks

I get reported execution total time from 84 to 102 seconds, while it
actually took not more than 25 seconds.

I set environment wariable RUBY_PROF_CPU_FREQUENCY to various values
scaling them 10 times, but it seemes had no influence on execution total
time. Also I tried same with --mode key values cpu, wall.

How can I get more realistic totals?

win xp sp3, core2duo T2300 @1.66GHz
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
 
R

Roger Pack

I set environment wariable RUBY_PROF_CPU_FREQUENCY to various values
scaling them 10 times, but it seemes had no influence on execution total
time. Also I tried same with --mode key values cpu, wall.

which version of ruby-prof? (RUBY_PROF_CPU_FREQUENCY only helps with
timing if you have an Intel chip and use that mode).
Thanks.
-r
 
Z

Zhoran Tvalve

Roger said:
which version of ruby-prof?

ruby-prof-0.7.3-x86-mswin32-60

I've just tried again

set RUBY_PROF_CPU_FREQUENCY=1 782 411 428 (1.66*1024*1024*1024)
then ran

C:\InstantRails\rails_apps\projectN>"ruby-prof" "--printer=graph_html"
"--file=ruby_prof.rake.html" "--min_percent=1.00" "--mode=cpu" "--"
"C:\InstantRails\ruby\bin\rake" --tasks

got about 105 seconds

then set RUBY_PROF_CPU_FREQUENCY=178 241 142 (previous value/10)
and got about 110 seconds
 
R

Roger Pack

Zhoran said:
ruby-prof-0.7.3-x86-mswin32-60

All righty update your gem, give 'er a shot again and report back.

E:\installs\ruby_msvc\bin>gem install ruby-prof
Successfully installed ruby-prof-0.8.1-x86-mswin32
1 gem installed

Thanks for the kick in the pants to use rake compiler :)

-rp
 
Z

Zhoran Tvalve

Roger said:
All righty update your gem, give 'er a shot again and report back.

E:\installs\ruby_msvc\bin>gem install ruby-prof
Successfully installed ruby-prof-0.8.1-x86-mswin32
1 gem installed

Thanks for the kick in the pants to use rake compiler :)


Hi, Roger
updated gem and made two series of shots with the same two
RUBY_PROF_CPU_FREQUENCY values. Both RUBY_PROF_CPU_FREQUENCY values
178241142 and 1782411428 result in 18-19 secs

Now it reports more realistic - 18 secs while it took about 23 secs as
showed my watch. A compared my watch to computer clock, and found it's
ok ) Could the difference take place due to concurrent process execution
environment?
 
R

Roger Pack

Hi, Roger
updated gem and made two series of shots with the same two
RUBY_PROF_CPU_FREQUENCY values. Both RUBY_PROF_CPU_FREQUENCY values
178241142 and 1782411428 result in 18-19 secs

Now it reports more realistic - 18 secs while it took about 23 secs as
showed my watch. A compared my watch to computer clock, and found it's
ok ) Could the difference take place due to concurrent process execution
environment?

Note well that it won't actually use RUBY_PROF_CPU_FREQUENCY unless you
specify --mode=cpu

Thanks!
-rp
 
Z

Zhoran Tvalve

Roger said:
Note well that it won't actually use RUBY_PROF_CPU_FREQUENCY unless you
specify --mode=cpu

Thanks!
-rp

Roger,
I like ruby-prof, and find it very helpful. Thank you for it! And best
wishes )

Zhoran
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top