[#4766] Wiki — "Glen Stampoultzis" <trinexus@...>

21 messages 2000/09/04
[#4768] RE: Wiki — "NAKAMURA, Hiroshi" <nahi@...> 2000/09/04

Hi, Glen,

[#4783] Re: Wiki — Masatoshi SEKI <m_seki@...> 2000/09/04

[#4785] Re: Wiki — "NAKAMURA, Hiroshi" <nakahiro@...> 2000/09/05

Howdy,

[#4883] Re-binding a block — Dave Thomas <Dave@...>

16 messages 2000/09/12

[#4930] Perl 6 rumblings -- RFC 225 (v1) Data: Superpositions — Conrad Schneiker <schneik@...>

Hi,

11 messages 2000/09/15

[#4936] Ruby Book Eng. translation editor's questions — Jon Babcock <jon@...>

20 messages 2000/09/16

[#5045] Proposal: Add constants to Math — Robert Feldt <feldt@...>

15 messages 2000/09/21

[#5077] Crazy idea? infix method calls — hal9000@...

This is a generalization of the "in" operator idea which I

17 messages 2000/09/22

[#5157] Compile Problem with 1.6.1 — Scott Billings <aerogems@...>

When I try to compile Ruby 1.6.1, I get the following error:

15 messages 2000/09/27

[ruby-talk:5102] Re: regexp and performance

From: ts <decoux@...>
Date: 2000-09-25 12:48:39 UTC
List: ruby-talk #5102
>>>>> "D" == DaVinci  <bombadil@wanadoo.es> writes:

D> 	Do you have noticed this? am I wrong?... What can be the reason?.

 Probably this is not the regexp engine

pigeon% cat ~/occur.rb
# word occurrence listing
# usege: ruby occur.rb file..
freq = Hash.new(0)
while gets()
  for word in $_.split(/\W+/)
    freq[word] += 1
  end
end
pigeon% 

pigeon% time ./ruby ~/occur.rb ~/aa

real    1m44.976s
user    1m44.440s
sys     0m0.510s
pigeon%
 
pigeon% ./ruby -v
ruby 1.4.6 (2000-08-16) [i686-linux]
pigeon% 

  %   cumulative   self              self     total           
 time   seconds   seconds    calls  ms/call  ms/call  name    
 31.55     19.89    19.89 94944089     0.00     0.00  rb_gc_mark
 19.46     32.16    12.27   812670     0.02     0.02  st_foreach
 14.42     41.25     9.09     1030     8.83     9.19  gc_sweep
  5.30     44.59     3.34  1614849     0.00     0.00  ruby_re_match
  3.49     46.79     2.20 46191335     0.00     0.00  mark_hashentry
  3.31     48.88     2.09  2909817     0.00     0.00  st_lookup
  3.01     50.78     1.90  1453442     0.00     0.00  rb_eval

pigeon% time ./ruby ~/occur.rb ~/aa
 
real    2m24.489s
user    2m24.190s
sys     0m0.320s
pigeon%

pigeon% ./ruby -v
ruby 1.6.1 (2000-09-22) [i686-linux]
pigeon% 

  %   cumulative   self              self     total           
 time   seconds   seconds    calls  ms/call  ms/call  name    
 33.96     30.03    30.03 143379443     0.00     0.00  rb_gc_mark
 20.62     48.26    18.23  1262040     0.01     0.01  st_foreach
 17.97     64.15    15.89     1560    10.19    10.43  gc_sweep
  4.39     68.03     3.88 69735121     0.00     0.00  mark_hashentry
  4.12     71.67     3.64  1614849     0.00     0.02  ruby_re_match
  2.49     73.87     2.20  2909989     0.00     0.00  st_lookup
  1.97     75.61     1.74  1453442     0.00     0.00  rb_eval

 why the difference on st_foreach ?

 If I disable the GC


pigeon% cat ~/occur.rb
# word occurrence listing
# usege: ruby occur.rb file..
GC.disable
freq = Hash.new(0)
while gets()
  for word in $_.split(/\W+/)
    freq[word] += 1
  end
end
pigeon% 

 1.4.6

pigeon% time ./ruby ~/occur.rb ~/aa

real    0m44.605s
user    0m43.580s
sys     0m0.410s
pigeon% 


 1.6 (see %MEM   VSZ  RSS ) and it has not finished


pigeon% ps aux | head -1
USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
pigeon% 
pigeon% ps aux | grep ruby
ts        5730 33.9 86.6 371040 223032 ttyp2 R    14:37   1:19 ./ruby /home/ts/o
ccur.rb /home/ts/aa
ts        5746 43.0  0.1  1104  412 ttyp7    S    14:40   0:00 grep ruby
pigeon% 

 

Guy Decoux

In This Thread

Prev Next