Permalink
Switch branches/tags
Commits on May 12, 2012
  1. Improve concurrency performance by cache locality

    ryoqun committed May 12, 2012
    There is a bottle neck in SharedState::check_gc_p. It is called from all Ruby
    threads and always writes to memory. That invalidates CPU cache and thus,
    everything is slowed down.
    
    Actually writing isn't necessary in this case. It is only when the gc flag is
    set. And that situation is unlikely.
    
    This commit removes the bottle neck by avoiding writing. So that, each CPU core
    runs at their full speed, not hampered by slow memory fetching due to cache
    invalidation.
    
    check_gc_p is heavily called under concurrently-executed tight loops (happen
    sometime in the real word, are excised often by people interested in Rubinius's
    promised concurrency)
    
    After this commit, each concurrent thread executes specially synthesized test
    code as roughly fast as a single thread. This doesn't tell that  Rubinius
    executes Ruby code purely proportional to the number of CPU cores. However it
    does that Rubinius runs its vm and has a potential to run Ruby code at the
    speed.
    
    Hello true concurrency :)
    
    I measured performance as follows.
    
    BEFORE THIS COMMIT:
    1 thread:
    2.225222 seconds for looping 100000000 times
    2.22639 seconds for looping 100000000 times
    2.223919 seconds for looping 100000000 times
    2.231417 seconds for looping 100000000 times
    
    2 threads:
    4.393776 seconds for looping 100000000 times
    4.284649 seconds for looping 100000000 times
    4.347468 seconds for looping 100000000 times
    4.279089 seconds for looping 100000000 times
    
    AFTER THIS COMMIT:
    1 thread:
    2.052846 seconds for looping 100000000 times
    2.054754 seconds for looping 100000000 times
    2.066346 seconds for looping 100000000 times
    2.071744 seconds for looping 100000000 times
    
    2 threads:
    2.243053 seconds for looping 100000000 times
    2.274827 seconds for looping 100000000 times
    2.24769 seconds for looping 100000000 times
    2.270161 seconds for looping 100000000 times
    
    TEST CODE:
    loop_count = 100_000_000
    threads = 2
    threads.times.collect do
      Thread.new do
        loop do
          time = Time.now
          i = loop_count
          i -= 1 until i.zero?
          puts "#{Thread.current}: #{Time.now - time} seconds for looping " +
               "#{loop_count} times"
        end
      end
    end.each(&:join)
  2. Improve GlobalCache's cache locality

    ryoqun authored and Ryo Onodera committed Mar 20, 2012
Commits on May 11, 2012
  1. Remove trailing white spaces

    ryoqun committed May 9, 2012
  2. Merge pull request #1714 from dubek/time_with_rational_offest_for_19

    abyx committed May 11, 2012
    Time accepts a Rational offset
Commits on May 10, 2012
Commits on May 9, 2012
  1. Merge pull request #1711 from r-stu31/spec_splat_orarray

    arthurschreiber committed May 9, 2012
    Add a test case for a splat of 'obj || []'.
  2. Tag failing splat spec.

    r-stu31 committed May 9, 2012
  3. Add a test case for a splat of 'obj || []'. This is currently failing…

    r-stu31 authored and rudolf committed May 9, 2012
    … under Rubinius.
Commits on May 8, 2012
  1. Merge pull request #1709 from troessner/master

    jc00ke committed May 8, 2012
    BasicObject includes itself in its list of constants.
  2. Hex letters should be downcased

    jc00ke committed May 8, 2012
    This came up when fixing a bug in MagLev
    MagLev/maglev@78e9025
  3. A misplaced retry statement raising a SyntaxError is a 1.9 feature, a…

    ileitch committed May 8, 2012
    …nd not specific to Fiber#new.
Commits on May 7, 2012
  1. Tag failing specs

    jfirebaugh committed May 7, 2012
  2. Remove Open3.popen3 tags

    jfirebaugh committed May 7, 2012
  3. $? is thread-local in 1.9

    jfirebaugh committed May 7, 2012
  4. $? is thread-local in 1.9

    jfirebaugh committed May 7, 2012
  5. Fix CompiledFile unmarshalling

    jfirebaugh committed May 7, 2012
    This Ruby unmarshaller is not currently exercised by normal code
    loading: it uses marshal.cpp instead.
    
    Fixes #1706.