Charles Oliver Nutter | 1 Nov 2007 01:00
Picon
Gravatar

Re: JRuby perf questions answered

Roger Pack wrote:
> Roger Pack wrote:
>>> any questions?
>> Startup time and comparison with 1.9? :)
> 
> Also memory use comparison compared to normal C version.  Does the GC 
> throw as often, too?

In profiling most apps I've tried, even pretty brutal ones generating a 
lot of garbage, the GC cost is almost invisible. A tiny blip once in a 
while.

I don't have any really good concrete numbers on overall memory usage. 
Tom's done a comparison of a minimal/bare Rails app here:

http://www.bloglines.com/blog/ThomasEEnebo?id=38

The general story is that per JRuby on Rails instance (usually you have 
many in a single JVM), we use less memory than an equivalent Mongrel + 
Ruby + Rails process.

A quick check of "jirb" compared to "irb" gives me:

jirb: 27MB
irb: 2.8MB

This is on OS X, Java 6 preview version, so it's safe to say that any 
JRuby process will have an initial cost of about 25MB to start up the JVM.

We've also done a lot in 1.1 to reduce memory consumption, and there's 
(Continue reading)

7stud -- | 1 Nov 2007 01:03
Picon
Favicon

Re: why, or when to, use a class method?

Thufir wrote:
> On Oct 31, 2:17 pm, 7stud -- <bbxx789_0... <at> yahoo.com> wrote:
> [...]
>> > Why use a class method in the first example, though?
>>
>> So that you can check whether a Song is too long without having to
>> create a SongList object:
> [...]
> 
> What would be a case where there's a SongList object, though? 

class Song
  attr_accessor :duration

  def initialize(len)
     <at> duration = len
  end
end

class SongList
  MaxTime = 5*60
  attr_accessor :songs

  def initialize(song_arr)
     <at> songs = song_arr
  end

  def isTooLong(aSong)
    return aSong.duration > MaxTime
  end
(Continue reading)

Rick DeNatale | 1 Nov 2007 01:20
Picon

Re: Rubyconf Attendees

On 10/31/07, David A. Black <dblack <at> rubypal.com> wrote:

> Not everyone is an alumnus of an earlier RubyConf, though. If you
> don't have a t-shirt you can just walk around holding the Pickaxe :-)

Well I won't be at the airport anyway, and I'm staying at the
Courtyard down the street, but in case anyone is interested I just
added this:
http://talklikeaduck.denhaven2.com/articles/2007/10/31/see-you-at-rubyconf
with a certain amount of trepidation.

I also replaced my facebook profile photo with this since it's much
more recent <G>

--

-- 
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

7stud -- | 1 Nov 2007 01:21
Picon
Favicon

Re: .each do |foo, bar| what does bar do?

David A. Black wrote:
>

Thanks for the explanation on the &block question.

> 
> I'm still not understanding what the problem was with my example. I'm
> doing:
> 
>    yield(key,self[key])
> 
> and if you do:
> 
>    hash.each {|k,v| ... }
> 
> you should be fine -- no warning.
> 

Yes.  But there is a problem when you do:

hash.each {|arr| ...}

On the other hand, when you write:

hash.each {|arr| ...}

with the actual Hash#each method, there is no problem.
--

-- 
Posted via http://www.ruby-forum.com/.

(Continue reading)

Rick DeNatale | 1 Nov 2007 01:28
Picon

Re: .each do |foo, bar| what does bar do?

On 10/31/07, David A. Black <dblack <at> rubypal.com> wrote:

> There could even be a situation where you would do:
>
>    some_method(proc_1, proc_2) &proc_3

I think you meant

     some_method(proc_1, proc_2 &proc_3)

--

-- 
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

Anthony Eden | 1 Nov 2007 01:32
Picon
Gravatar

Re: Rubyconf Attendees

On 10/31/07, Matt Lawrence <matt <at> technoronin.com> wrote:
> On Thu, 1 Nov 2007, David A. Black wrote:
>
> > Not everyone is an alumnus of an earlier RubyConf, though. If you
> > don't have a t-shirt you can just walk around holding the Pickaxe :-)
>
> But how do you get a pickaxe through security?

If you have to ask you don't deserve to get a pickaxe through security. ;-)

-A

--

-- 
Cell: 321 473-4966
Current Location: Melbourne, FL
Home Location: Melbourne, FL

Lloyd Linklater | 1 Nov 2007 02:00

Re: JRuby perf questions answered

There was a recent thread which asked how fast ruby ran for each user.

http://www.ruby-forum.com/topic/125344#new

Josip Gracin wrote:
> Here's something interesting.  The processor is Intel T7200  <at>  2.00GHz,
> Linux Ubuntu.
> 
> 1. With ruby 1.8.5. which comes packaged with Ubuntu:
> 
>     Ruby 1.8.5 on i486-linux
>     It took 20.346013 seconds to run. 49149 iterations per
>     second.
> 
> 2. With ruby 1.9.0 (2006-06-08) which comes packaged in Ubuntu:
> 
>     Ruby 1.9.0 on i486-linux
>     It took 23.875774 seconds to run. 41883 iterations per
>     second.
> 
> 
> 3. With ruby 1.8.6 compiled from sources on the machine:
> 
>     Ruby 1.8.6 on i686-linux
>     It took 7.107875 seconds to run. 140689 iterations per
>     second.
> 
> 
> Obviously, the target instruction set matters quite a lot.  I think I'll
> be compiling my own ruby from now on. :-)
(Continue reading)

Lloyd Linklater | 1 Nov 2007 02:04

Re: Non-blocking 'gets' ?

Wurzel Cidermaker wrote:
> Lloyd Linklater wrote:
>> Why don't you just bind a keypress event?  That would capture any given 
>> keystroke in a non blocking way.
> 
> Can you provide an example?

I got the idea from the pickaxe book starting on page 246.
--

-- 
Posted via http://www.ruby-forum.com/.

7stud -- | 1 Nov 2007 02:12
Picon
Favicon

Re: Dinner / drink recommendations for Charlotte?

Matt Lawrence wrote:
> On Thu, 1 Nov 2007, Francis Hwang wrote:
> 
>> With RubyConf 2007 almost upon us, do any Charlotte natives care to
>> give some advice about good places to eat & drink?
> 
> You expect to get out of the hotel?  Wow.  I'm expecting a few days of
> intense learning and networking with some of the most brilliant people I
> have ever met.  Food and drink are far less interesting.
> 
> Now, if somebody wanted to talk to me about a job, I might be able to 
> make
> time for it.
>

Would you consider hawking "Learning Python" books to the uninitiated? 
It won't take much effort.  If you read a few passages to the throng, 
they will snap up all the copies you have.

--

-- 
Posted via http://www.ruby-forum.com/.

Joel VanderWerf | 1 Nov 2007 02:21
Picon

Re: DistribuStream

Tony Arcieri wrote:
> DistribuStream is an open peer-to-peer communications system which aims to
> become the successor to BitTorrent.

I'm quite interested in the "ad hoc HTTP caching proxy network" part. 
Some of the folks I work with in the CE dept at Berkeley want to use 
HTTP for services in ad hoc vehicle networks (VANET). In another 
project, I'm using ruby for HTTP proxying over mobile wireless networks 
using UDP broadcast on the wireless link (DSRC), instead of TCP, to 
avoid the setup time. Caching is valuable because the networks are so 
limited in bandwidth, latency, and connection duration.

However: there's gotta be a better name than DistribuStream. Why call it 
"distribu" stream if its main difference from BitTorrent is that it is 
more centralized? ("The onus of traffic scheduling is placed entirely on 
the server." Isn't that going to be a bottleneck, anyway? Or can the 
servers be distributed? How do they cooperate?)

If you'll forgive the suggestions, what about...?

Distributary (a branching river)
Bitstributary
Roost (like Joost, but "R" for ruby)
Distribrew
Brew
Brewst

Ignore the last few. I'm probably just feeling bad about not drinking 
beer with all the great ruby minds.

(Continue reading)


Gmane