<< Previous | Home

Profiling JRuby with NetBeans

A case study and tutorial on using the NetBeans profiler to profile Ruby code running on the JVM via JRuby. Walks through the steps of configuring NetBeans, launching JRuby with profiling settings, connecting NetBeans to JRuby, and analyzing the results.


Comparing Ruby exceptions to additional stat() test

A common idiom in Ruby code (FileUtils, ActiveSupport, Hike) when dealing with a file or directory that may or may not exist is to go ahead and call a method that expects the file to exist (such as open), and catch the exception raised for nonexistent files. This is generally a poor choice performance-wise on JRuby, but is also not necessarily ideal on MRI.


ActiveRecord connection pool fairness

ActiveRecord maintains a pool of database connections that may be used by multiple threads to perform database work. If many threads are contending for a smaller number of connections, the behavior of the connection pool becomes important.


Tags : , ,

Asynchronous responses in Rack

Rack is an interface for Ruby components accepting and responding to HTTP requests synchronously. Though there is not an official Rack spec for asynchronous responses, Rack servers such as Rainbows! and Thin provide an asynchronous interface for responses that may happen at an unknown time in the future, such as in a web chat room.


Tags : ,