Kurt Stephens

Nerd Up!

ruby

CheapAdvice

Kurt on Thu, 2011-09-29 14:44.

  • Dumb Code is Clean Code.
  • Smart Code is Dirty Code.
  • Advice is not Aspects.
  • Advice is objects.
  • Advice is dynamic.
  • Slides

The Broken Promises of MRI/REE/YARV

Kurt on Wed, 2011-07-06 16:34.

Joe Damato drills deep into the implied contracts of the MRI/C API:

http://timetobleed.com/the-broken-promises-of-mrireeyarv/

The need for RB_GC_GUARD(v) is probably due to faulty register spilling in the MRI eval/thread/GC machinery; the PRE_GETCONTEXT() and POST_GETCONTEXT() macros in MRI eval.c might be the real problem.

In contrast, the Boehm-Demers-Weiser (BDW) GC library manages to scan registers without demanding client code to explicitly flush pointers to the stack.

However, in general, it is problematic, in language design practice to make GC contracts completely transparent to API client code. This difficultly is explicitly solved in the design of Lua:

Ruby: REE RUBY_HEAP allocation parameter and page alignment improvements.

Kurt on Fri, 2011-03-18 17:15.

http://code.google.com/p/rubyenterpriseedition/issues/detail?id=67


Use mmap() to allocate heaps by default.
Use mmap() MAP_ANON, instead of /dev/zero.
Align mmap() size to pagesize.
Align heap allocation size to pagesize.
Expand heap slotlimit to fit in aligned allocation.
New $RUBY_HEAP_* options: RUBY_HEAP_INIT_SLOTS=N initial number of slots per heap. RUBY_HEAP_MIN_SLOTS=N value is independent of RUBY_HEAP_INIT_SLOTS. RUBY_HEAP_MAX_SLOTS=N max number slots for a heap. RUBY_HEAP_PAGESIZE=bytes defaults to PAGESIZE or 4096. RUBY_HEAP_SLOTS_INCREMENT=N

Ruby: Thread stack leak patch accepted into REE.

Kurt on Mon, 2011-02-14 14:56.

This patch reduces the stack buffer memory footprint of dead Threads as early as possible, rather than waiting until the Thread can be GCed.

This is applicable only to the zero-copy context switch patch.

http://code.google.com/p/rubyenterpriseedition/issues/detail?id=57

http://blog.phusion.nl/2011/02/12/ruby-enterprise-edition-1-8-7-2011-01-...


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.


Syndicate content

Primary links

Syndicate

Syndicate content

Browse archives

« May 2012  
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 31