# Ruby PDQ?

**URL:** <https://www.ruby-forum.com/t/ruby-pdq/77611>\
**Category:** Ruby\
**Created:** [November 29, 2006, 5:47am UTC](https://www.ruby-forum.com/t/ruby-pdq/77611 "2006-11-29T05:47:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [November 29, 2006, 5:47am UTC](https://www.ruby-forum.com/t/ruby-pdq/77611/1 "2006-11-29T05:47:59Z")

</div>

Hi all,

I happened across this book at the store tonight:  
[Analyzing Computer System Performance with Perl::PDQ](http://www.perfdynamics.com/iBook/ppa_new.html). PDQ is an acronym for  
“Pretty Damn Quick” that appears to be used for systems performance  
modeling.

It looks interesting. There are Perl and Python bindings, but none for  
Ruby.

Anyone need a project? 🙂

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [November 29, 2006, 7:10am UTC](https://www.ruby-forum.com/t/ruby-pdq/77611/2 "2006-11-29T07:10:13Z")

</div>

Daniel B. wrote:

> Anyone need a project? 🙂
> 
> Regards,
> 
> Dan

Funny you should mention PDQ and Ruby. One of the people I work with  
just got back from his class. If you look carefully in the distribution  
(hints for finding it are on Dr. Gunther’s web page) you will find the C  
code for PDQ, and it’s easy to wrap in Ruby or any other language. I  
don’t know about the Python version, but the Perl version simply calls  
the C code to do the real work.

He has a new book coming out very soon now. It’s been printed and  
distributed in Europe, but it hasn’t started shipping in the USA yet.  
PDQ is indeed “used for system performance modeling”. But the algorithms  
are simple enough that you can code them by hand. And I see little  
reason to rewrite them in Ruby if you can read either C, Perl or Python.

–  
M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)  
[http://borasky-research.blogspot.com/](http://borasky-research.blogspot.com/)

If God had meant for carrots to be eaten cooked, He would have given  
rabbits fire.

---

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [November 29, 2006, 1:20pm UTC](https://www.ruby-forum.com/t/ruby-pdq/77611/3 "2006-11-29T13:20:52Z")

</div>

M. Edward (Ed) Borasky wrote:

> > Anyone need a project? 🙂
> > 
> > Regards,
> > 
> > Dan
> 
> Funny you should mention PDQ and Ruby. One of the people I work with  
> just got back from his class. If you look carefully in the distribution  
> (hints for finding it are on Dr. Gunther’s web page) you will find the C  
> code for PDQ, and it’s easy to wrap in Ruby or any other language.

Yes, I figured someone might be interested in writing a Ruby/C  
extension.

> He has a new book coming out very soon now. It’s been printed and  
> distributed in Europe, but it hasn’t started shipping in the USA yet.

It’s available in the US. I saw it at a Borders Bookstore. 🙂

> PDQ is indeed “used for system performance modeling”. But the algorithms  
> are simple enough that you can code them by hand. And I see little  
> reason to rewrite them in Ruby if you can read either C, Perl or Python.

And for the people who can’t, it would be nice to have a Ruby binding.  
🙂

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [December 14, 2006, 6:00am UTC](https://www.ruby-forum.com/t/ruby-pdq/77611/4 "2006-12-14T06:00:56Z")

</div>

Daniel B. wrote:

> Anyone need a project? 🙂
> 
> Regards,
> 
> Dan

Well, actually …

[http://rubyforge.org/viewvc/SPQR/?root=cougar](http://rubyforge.org/viewvc/SPQR/?root=cougar)

But …

1. I don’t really like the algorithms in PDQ. They’re way too limited –  
essentially, Gunther makes you code everything in raw Perl except the  
“vanilla” open circuit and closed circuit solvers.

2. Gunther’s books have a few tidbits none of the others have, but it’s  
more “here’s the formulas, here’s a bunch of Perl code, and here’s how I  
solved problems with it.” And they’re pretty hard to read relative to  
some of the others. His class, on the other hand, is excellent. He’s  
really the only one outside of a university setting that teaches this  
kind of material, at least in the USA.

So … rather than re-implement PDQ in Ruby – which I’m sure someone  
else will take on – I decided to switch authors, books _and_  
algorithms. 🙂 Specifically, I’ve based SPQR (Stuff for Processing  
Queuing models in Ruby) on the multi-class open and closed network  
solvers with load dependent service centers in _Performance By Design_,  
by Daniel A. Menasce, Virgilio A. F. Almeida, and Larry W. Dowdy.

I just posted the Rakefile, the main Ruby code and the RSpec “spec” file  
– I’m attempting to learn behavior-driven design with this code. Right  
now, all that’s there is the closed network solver and one test case  
taken from an earlier book by the same authors. I’m hoping to get the  
open network solver running over the weekend. The code isn’t very well  
documented, but the book has all the gory details anyway. It’s badly in  
need of refactoring as well; some entities in the algorithm are  
“naturally” two-dimensional so the way I factored things doesn’t always  
make much sense.

So … I hate to make everyone buy another book, but, well, that’s life  
when you’re a performance engineer. 🙂

P.S.: I was originally going to call it “RubyQueues” but I discovered  
there’s already a “Ruby queue”, so I scrambled around for another name.

> 

–  
M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)  
[http://borasky-research.blogspot.com/](http://borasky-research.blogspot.com/)

If God had meant for carrots to be eaten cooked, He would have given  
rabbits fire.

---

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [December 14, 2006, 6:28am UTC](https://www.ruby-forum.com/t/ruby-pdq/77611/5 "2006-12-14T06:28:58Z")

</div>

On Thu, 14 Dec 2006, M. Edward (Ed) Borasky wrote:

> P.S.: I was originally going to call it “RubyQueues” but I discovered there’s  
> already a “Ruby queue”, so I scrambled around for another name.

sorry! 😉

-a

---

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [December 14, 2006, 7:19am UTC](https://www.ruby-forum.com/t/ruby-pdq/77611/6 "2006-12-14T07:19:03Z")

</div>

removed\_email\_address@domain.invalid wrote:

> On Thu, 14 Dec 2006, M. Edward (Ed) Borasky wrote:
> 
> > P.S.: I was originally going to call it “RubyQueues” but I discovered  
> > there’s already a “Ruby queue”, so I scrambled around for another name.
> 
> sorry! 😉
> 
> -a  
> well … you did get there first … but then, maybe I can use SPQR to  
> model RQ on the QT, unless that would mean I’m SOL.

VBG

–  
M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)  
[http://borasky-research.blogspot.com/](http://borasky-research.blogspot.com/)

If God had meant for carrots to be eaten cooked, He would have given  
rabbits fire.
