Bindings, Platforms, and Innovation
This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.
Tracking change and innovation in the enterprise software development community
Posted by Peter Cooper on Jul 28, 2006 12:19 PM
It's well accepted that Ruby is no performance champion. It's execution speed is slower than that of similar scripting languages like Perl and Python, and significantly slower than lower-level languages like C. Ruby was designed to be a quick language to code in and develop for, but not a quick language in terms of its performance.
On the Ruby newsgroup, comp.lang.ruby, Peter Hickman started a thread suggesting "For performance, write it in C." This approach has been traditionally popular for languages like Perl, and is now becoming common with Ruby. One of Hickman's demonstrations yielded over a 100 times speed improvement between some demonstration Perl code and a C implementation, so the benefits are obvious, and as a language with a compiler on nearly every platform, C makes a good choice for a fast, lower-level language with which to write high-performance code.
With Ruby, there are two options available for using C. The traditional way is to create an extension for Ruby in C that's compiled separately and included in, like a library. You can learn how to do this in How to Create a Ruby Extension in 5 Minutes. A new approach, however, is to use the RubyInline library, a library that allows you to write C alongside your Ruby code. For small routines this is significantly quicker than going to the efforts of writing a whole library in C (though not by much), and also 'cleaner' code-wise. Some Ruby source code demonstrating RubyInline is available.
Inspired by the newsgroup thread, Pat Eyler wrote " RubyInline, Making Making Things Faster Easier" with a demonstration and benchmark results of how he used RubyInline to significantly speed up the calculation of prime numbers, and then immediately followed it up with "RubyInline: Going a bit Further". Both articles provide a good look at the performance gains possible by using inline C.
Effective Management of Static Analysis Vulnerabilities and Defects
The Role of Open Source in Data Integration
The Agile Business Analyst: Skills and Techniques needed for Agile
I think the tutorial about creating ruby extensions in 5 minutes should be renamed somehow to: creating ruby extensions in 5 minutes (or a couple of days) :-] (for reference: additional requirements for a Ruby env and the other thread originated in this one: OneClick Installer: MinGW? or VC2005?). From this perspective RubyInline looks very interesting. ./alex -- .w( the_mindstorm )p.
I was hoping this was a joke, but now all I can do is laugh anyway. This takes the cake. I give up.
Not wanting to start a flame, but I haven't caught the funny part :-[. ./alex -- .w( the_mindstorm )p.
I agree with Alex, I'm not sure why you think this is funny. Ruby provides decent profiling and benchmarking tools to help identify the bottlenecks in your program(s). If refactoring the Ruby for better performance doesn't help enough, the option to easily rewrite a method or two in C without having to throw away the rest of the Ruby program seems like a pretty clear win.
given that the project has been public since 2002, it is hardly new. I might also add that I was able to duplicate the 5 minute traditional effort (including editing/compiling/linking/loading/running) in about 30 seconds with much cleaner code. See my full response on the original article's page.
This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.
This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.
This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.
This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.
This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.
After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.
IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.
Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.
5 comments
Watch Thread Reply