[#4745] Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — Erik Huelsmann <ehuels@...>

Having taken upon me the task to provide a Windows build for

24 messages 2005/04/20
[#4746] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — Austin Ziegler <halostatue@...> 2005/04/20

On 4/20/05, Erik Huelsmann <ehuels@gmail.com> wrote:

[#4747] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — Erik Huelsmann <ehuels@...> 2005/04/20

Hi Austin,

[#4762] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — nobu.nokada@... 2005/04/24

Hi,

[#4783] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — Erik Huelsmann <ehuels@...> 2005/04/25

On 4/24/05, nobu.nokada@softhome.net <nobu.nokada@softhome.net> wrote:

[#4787] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — nobu.nokada@... 2005/04/25

Hi,

[#4794] Re: Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — Erik Huelsmann <ehuels@...> 2005/04/25

> > > Ruby is just using AC_TYPE_UID_T. So, using typedef for them,

[#4751] Illegal regexp causes segfault — Andrew Walrond <andrew@...>

irb(main):058:0> a = /\[([^]]*)\]/

13 messages 2005/04/22

Re: profiler.rb Schroedinbug

From: "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
Date: 2005-04-25 06:49:48 UTC
List: ruby-core #4781
C Erler <erlercw@gmail.com> wrote:
(2005/04/25 14:11)

>> Can you show us your ruby's version?
>> 
>ruby 1.8.2 (2004-12-25) [i386-mswin32]
>(the one click Windows installer, which I reinstalled just now to double check)
>
>It was someone on #ruby-lang on Freenode who reported the same bug with 1.9..

Umm, I couldn't reproduce the problem also with that version.

# http://rubyforge.org/frs/download.php/2407/ruby182-14.exe

E:\RUBY-1~1.2-I\bin>echo require 'profile' > test.rb

E:\RUBY-1~1.2-I\bin>ruby -v test.rb
ruby 1.8.2 (2004-12-25) [i386-mswin32]
  %   cumulative   self              self     total
 time   seconds   seconds    calls  ms/call  ms/call  name
500.00     0.05      0.05        1    50.00    50.00  Profiler__.start_profile
  0.00     0.05      0.00        1     0.00    10.00  #toplevel

////////////////////////////////////////////////////////////

But interesting. Can you show me your profile.rb and profiler.rb in lib\ruby\1.8?

I'll attach my files.

Attachments (2)

profile.rb (90 Bytes, text/x-ruby)
require 'profiler'

END {
  Profiler__::print_profile(STDERR)
}
Profiler__::start_profile
profiler.rb (1.62 KB, text/x-ruby)
module Profiler__
  Times = if defined? Process.times then Process else Time end
  # internal values
  @@start = @@stack = @@map = nil
  PROFILE_PROC = proc{|event, file, line, id, binding, klass|
    case event
    when "call", "c-call"
      now = Float(Times::times[0])
      @@stack.push [now, 0.0, id]
    when "return", "c-return"
      now = Float(Times::times[0])
      tick = @@stack.pop
      name = klass.to_s
      if name.nil? then name = '' end
      if klass.kind_of? Class
	name += "#"
      else
	name += "."
      end
      name += id.id2name
      data = @@map[name]
      unless data
	data = [0.0, 0.0, 0.0, name]
	@@map[name] = data
      end
      data[0] += 1
      cost = now - tick[0]
      data[1] += cost
      data[2] += cost - tick[1]
      @@stack[-1][1] += cost
    end
  }
module_function
  def start_profile
    @@start = Float(Times::times[0])
    @@stack = [[0, 0, :toplevel], [0, 0, :dummy]]
    @@map = {"#toplevel" => [1, 0, 0, "#toplevel"]}
    set_trace_func PROFILE_PROC
  end
  def stop_profile
    set_trace_func nil
  end
  def print_profile(f)
    stop_profile
    total = Float(Times::times[0]) - @@start
    if total == 0 then total = 0.01 end
    @@map["#toplevel"][1] = total
    data = @@map.values
    data.sort!{|a,b| b[2] <=> a[2]}
    sum = 0
    f.printf "  %%   cumulative   self              self     total\n"           
    f.printf " time   seconds   seconds    calls  ms/call  ms/call  name\n"
    for d in data
      sum += d[2]
      f.printf "%6.2f %8.2f  %8.2f %8d ", d[2]/total*100, sum, d[2], d[0]
      f.printf "%8.2f %8.2f  %s\n", d[2]*1000/d[0], d[1]*1000/d[0], d[3]
    end
  end
end

In This Thread