Kurt Stephens

Nerd Up!

ruby

Concrete Partial Evaluation in Ruby

Kurt on Fri, 2010-06-11 15:14.

http://www.computer.org/portal/web/csdl/doi/10.1109/eScience.2008.141

Abstract:


Software tools have become a central part of the scientific researchers’ toolbox, but developing them can prove a distraction from the central focus of a research team’s investigation. Dynamic languages, like Ruby, can provide an easy platform for rapid development and deployment of software that can be easily shared through SOAP, REST, or even RPC-style API interfaces with fellow researchers across the globe. In this extended abstract we present progress in addressing one of Ruby’s biggest shortcomings, performance. Our technique uses compiler analysis of Ruby’s C-based interpreter and core libraries in order to provide a basis for partial evaluation. The partial evaluator makes use of the results of this analysis along with a running Ruby session in order to evaluate more complex expressions than could normally be handled by traditional partial evaluation techniques, while ensuring that “unsafe” expressions are left for evaluation during run-time.

ChicagoRuby Ruby Code Tweaks slides, code and video

Kurt on Wed, 2010-05-05 12:59.

The slides from my ChicagoRuby 2010/5/4 presentation :

http://kurtstephens.com/pub/ruby/ruby_code_tweaks/

All the raw data used to generate the graph should be referenced in the slides.

The code used to generate the slides is here:

http://github.com/kstephens/ruby_code_tweaks

I’m looking to increase the set of code “Problems” to cover other tiny code idioms and platform issues, for example: regular expressions, numerics, etc. If you have ideas, take a look at the code and contact me.

Justin Love gave a fantastic presentation on lambda and closure.

Thanks to everyone who came — hope it was helpful.

Video from the talk:

Ruby Code Performance Tweaks by Kurt Stephens from ChicagoRuby on Vimeo.


Ruby: Fixnum#gcd accepted into MRI

Kurt on Mon, 2010-02-08 18:52.

Ruby rational.rb clean-up and the Fixnum#gcd primitive was refactored into a new MRI extension. Fixnum#gcd is now defined during require ‘rational’.

http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?...

http://redmine.ruby-lang.org/issues/show/2561

See http://kurtstephens.com/node/34 .


Emacs Flymake Ruby Mode

Kurt on Mon, 2009-12-28 03:40.

Adds automatic syntax checking and error highlighting to Ruby code:

http://github.com/purcell/emacs.d/raw/master/site-lisp/flymake-ruby/flym...


Ruby 1.8: Improved Rational performance by 15%

Kurt on Wed, 2009-12-23 21:27.

This should also speed up DateTime. This will not help 1.9 performance.

The attached file is based on MRI 1.8.6 rational.rb.

 > ruby rational_performance.rb 
                                              user     system      total        real
test_it                                  32.930000   3.030000  35.960000 ( 35.971832)
test_it                                  33.840000   2.910000  36.750000 ( 36.758585)
test_it ks_rational                      29.110000   2.460000  31.570000 ( 31.572762)

Overview:

  • case x; when Foo; ...; end is faster than if Foo.kind_of?(x).

Ruby: Caching #to_s for immutables (and a possible future for constant-folding)

Kurt on Mon, 2009-11-23 02:07.

Reference: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/26869

I have a proof-of-concept patch to MRI that caches #to_s values for immutable values. It is implemented using a few fixed-size hash tables.

It reduces the number of #to_s result objects by 1890 during the MRI test suite for NilClass#to_s, TrueClass#to_s, FalseClass#to_s, Symbol#to_s, and Float#to_s.

It requires a minor semantic change to Ruby core. This minor change could cascade into a huge performance improvement for all Ruby implementations — as will be illustrated later:

#to_s may return frozen Strings.

cabar - An Extensible Software Component Mangement System

Kurt on Wed, 2009-06-24 22:05.

Cabar – an extensible software component backplane for managing software components.

http://cabar.rubyforge.org/

http://github.com/kstephens/cabar/tree/master


Syndicate content

Primary links

Syndicate

Syndicate content

Browse archives

« September 2010  
Mo Tu We Th Fr Sa Su
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30