On Dec 13, 2011, at 7:03 PM, Charles Oliver Nutter wrote:

> A couple quick observations.
> 
> * I assume it's expected that the majority of time is spent in
> zmq_poll, which is an FFI Call to zmq. Excluding that from
> consideration...

Yes. The call to zmq_poll is essentially time spent blocked on I/O.


> * This is bad:
> 
> 16.57        0.76       15.81     3079083  Class#new
> 
> Three million new classes created. I'm sure it's singleton somewhere,
> but that's often a big perf sink...not necessarily because it impacts
> straight-line code a lot, but because a class object is a nontrivial
> thing to be creating three million of.

Is there a way for JRuby to output more detail on those classes? For example, can it tell me how many of each class type have been allocated? If so, I could use that information to figure out the critical path and try to reduce the amount of class creation there.

Also, I'm not certain what you mean by "I'm sure it's singleton somewhere." I know what a singleton is, but I don't understand your use of it in this context. Elaborate, please.


> * Going down the list, I don't see anything obvious to optimize in
> most of the hot methods. Usually when you have normalish-looking code
> that's really hot, the next thing to optimize is reducing object
> allocation as much as possible. In fact, that more than anything often
> improves perf on JRuby...but I'm not sure the effect on other impls.

I'll take a shot at reducing my object allocation. More information on how many of each type of object is being allocated would be a wonderful statistic to have. Also, if there were a way to trace that allocation back to a particular file and line number (for those cases where the same object is allocated in multiple places), that would be a killer profiling feature. <hint, hint>

Thanks for the pointers. I appreciate the help.

cr