Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Aug 30, 2012
  1. @brixen
Commits on Jul 30, 2012
  1. @dbussink
Commits on May 31, 2012
  1. @ileitch
  2. @ileitch

    Marshal doesn't use std::endl.

    ileitch authored
Commits on Feb 14, 2012
  1. @dbussink

    Handle cases where people throw in insanely big elements

    dbussink authored
    Theoretically one could crash the VM when using huge integers
    and other huge types. This makes sure we safely handle those
    cases by allocating a buffer for them if they need more space
    than we allocate on the stack by default.
Commits on Feb 13, 2012
  1. @dbussink
Commits on Jan 15, 2012
  1. @brixen

    Removed use of Qtrue|false|nil|undef from native code.

    brixen authored
    Also cleaned up definition of C-API macros. Absolutely no macros should have
    different definitions between the native code and the C-API code.
    
    Move definitions of MRI OOP bit patterns to the configure script.
    
    Added RBOOL() to convert a C++ bool to Ruby true or false.
Commits on Dec 31, 2011
  1. @brixen
Commits on Nov 1, 2011
  1. @evanphx
Commits on Oct 11, 2011
  1. @evanphx

    Fix 'for' in 1.9 mode

    evanphx authored
    This also adds the ability for a CompiledMethod to reference a constant
    inside the literals tuple. These constants are resolved at
    CompiledMethod load time only.
Commits on Jun 3, 2011
  1. @brixen
Commits on Jan 12, 2011
  1. @brixen
Commits on May 6, 2010
  1. Track if a CM is for a block properly finally

    Evan Phoenix authored
Commits on Dec 11, 2009
  1. Cull SendSite and Selector

    Evan Phoenix authored
Commits on Dec 8, 2009
  1. Abstract all uses of ByteArray::bytes

    Evan Phoenix authored
Commits on Nov 9, 2009
  1. @brixen
Commits on Nov 2, 2009
  1. @brixen

    Revert varint changes to .rbc format. See below.

    brixen authored
    This commit reverts 0322ef88 and e5aee27.
    
    There are several issues with the "packed int" approach to the .rbc
    file format:
    
    1. It requires additional complexity. While the complexity is not
       significant, it still needs to pay for itself by either reducing
       complexity somewhere else, or performing better. It does neither.
    2. It requires code that is used nowhere else. This means that normal
       code is not used and this use case doesn't exert pressure on
       improving the performance of normal code.
    3. The approach is ad hoc. If there is a demonstrated need to compress
       the size of the .rbc files, an appropriate solution is to add a
       standard compression algorithm and a configuration switch to enable
       compression in situations that need it. No such need has been
       demonstrated at this point.
    4. The code performs poorly compared to simple String#to_i and Fixnum
       or Bignum#to_s as shown by the benchmark below.
    5. The code dominates a profile of running the full CI specs while
       compiling with CompilerNG. Writing the .rbc files should not
       dominate compilation. It is hard to factor out the #to_varint
       contributions to the profile while trying to focus on real hot spots
       in the compiler. See http://gist.github.com/217085 for profile data.
       Reverting the varint change resulted in 10% fewer method calls.
    
    The format of Fixnums and Bignums was changed to hex. This can be converted
    from a string a byte at a time with ADD, SHIFT, AND operations. It is unlikely
    that any specialty format will be faster, simpler (it's supported by libc for
    size_of long and performs well for Bignums), and platform independent.
    
    The following benchmark was run in interpreter-only mode and with the JIT.
    
    require 'benchmark'
    
    total = (ENV['TOTAL'] || 100_000).to_i
    
    srand(42)
    fixnums = Array.new(total) { rand(100_000) }
    bignums = Array.new(total) { |i| fixnums[i] + Fixnum::MAX+1 }
    
    frings = fixnums.map { |n| n.to_s }
    brings = bignums.map { |n| n.to_s }
    
    fex = fixnums.map { |n| n.to_s 16 }
    bex = fixnums.map { |n| n.to_s 16 }
    
    class Rubinius::CompiledFile::Marshal
      public :to_varint, :read_varint
    
      def from_varint(str)
        @data = str
        @start = 0
    
        read_varint
      end
    end
    
    m = Rubinius::CompiledFile::Marshal.new
    
    farints = fixnums.map { |n| m.to_varint n }
    barints = bignums.map { |n| m.to_varint n }
    
    Benchmark.bmbm do |x|
      x.report "loop" do
        total.times { |i| fixnums[i] }
      end
    
      x.report "to_varint(Fixnum)" do
        total.times { |i| m.to_varint fixnums[i] }
      end
    
      x.report "to_s(Fixnum)" do
        total.times { |i| fixnums[i].to_s }
      end
    
      x.report "to_s(Fixnum) hex" do
        total.times { |i| fixnums[i].to_s 16 }
      end
    
      x.report "to_varint(Bignum)" do
        total.times { |i| m.to_varint bignums[i] }
      end
    
      x.report "to_s(Bignum)" do
        total.times { |i| bignums[i].to_s }
      end
    
      x.report "to_s(Bignum) hex" do
        total.times { |i| bignums[i].to_s 16 }
      end
    
      x.report "read_varint(Fixnum)" do
        total.times { |i| m.from_varint farints[1] }
      end
    
      x.report "to_i(Fixnum)" do
        total.times { |i| frings[i].to_i }
      end
    
      x.report "to_i(Fixnum) hex" do
        total.times { |i| fex[i].to_i 16 }
      end
    
      x.report "read_varint(Bignum)" do
        total.times { |i| m.from_varint barints[i] }
      end
    
      x.report "to_i(Bignum)" do
        total.times { |i| brings[i].to_i }
      end
    
      x.report "to_i(Bignum) hex" do
        total.times { |i| bex[i].to_i 16 }
      end
    end
    
    $ bin/rbx bm_varint.rb
    Rehearsal -------------------------------------------------------
    loop                  0.011476   0.000000   0.011476 (  0.011441)
    to_varint(Fixnum)     0.736448   0.000000   0.736448 (  0.736500)
    to_s(Fixnum)          0.038809   0.000000   0.038809 (  0.038885)
    to_s(Fixnum) hex      0.040427   0.000000   0.040427 (  0.040479)
    to_varint(Bignum)     0.881022   0.000000   0.881022 (  0.881064)
    to_s(Bignum)          1.844556   0.000000   1.844556 (  1.844599)
    to_s(Bignum) hex      0.780956   0.000000   0.780956 (  0.780999)
    read_varint(Fixnum)   0.292000   0.000000   0.292000 (  0.292055)
    to_i(Fixnum)          0.042187   0.000000   0.042187 (  0.042236)
    to_i(Fixnum) hex      0.032949   0.000000   0.032949 (  0.033026)
    read_varint(Bignum)   0.386262   0.000000   0.386262 (  0.386317)
    to_i(Bignum)          0.126643   0.000000   0.126643 (  0.126705)
    to_i(Bignum) hex      0.033061   0.000000   0.033061 (  0.033152)
    ---------------------------------------------- total: 5.246796sec
    
                              user     system      total        real
    loop                  0.006812   0.000000   0.006812 (  0.006771)
    to_varint(Fixnum)     0.285385   0.000000   0.285385 (  0.285438)
    to_s(Fixnum)          0.032994   0.000000   0.032994 (  0.033005)
    to_s(Fixnum) hex      0.030820   0.000000   0.030820 (  0.030846)
    to_varint(Bignum)     0.861277   0.000000   0.861277 (  0.861274)
    to_s(Bignum)          1.500316   0.000000   1.500316 (  1.500324)
    to_s(Bignum) hex      0.774484   0.000000   0.774484 (  0.774489)
    read_varint(Fixnum)   0.376256   0.000000   0.376256 (  0.174237)
    to_i(Fixnum)          0.025325   0.000000   0.025325 (  0.025341)
    to_i(Fixnum) hex      0.025602   0.000000   0.025602 (  0.025628)
    read_varint(Bignum)   0.571533   0.000000   0.571533 (  0.374191)
    to_i(Bignum)          0.115859   0.000000   0.115859 (  0.115883)
    to_i(Bignum) hex      0.026308   0.000000   0.026308 (  0.026337)
    
    $ bin/rbx -Xint bm_varint.rb
    Rehearsal -------------------------------------------------------
    loop                  0.013204   0.000000   0.013204 (  0.013153)
    to_varint(Fixnum)     0.917949   0.000000   0.917949 (  0.918003)
    to_s(Fixnum)          0.074931   0.000000   0.074931 (  0.075010)
    to_s(Fixnum) hex      0.068024   0.000000   0.068024 (  0.068086)
    to_varint(Bignum)     1.211573   0.000000   1.211573 (  1.211608)
    to_s(Bignum)          1.726354   0.000000   1.726354 (  1.726420)
    to_s(Bignum) hex      0.896392   0.000000   0.896392 (  0.896433)
    read_varint(Fixnum)   0.404205   0.000000   0.404205 (  0.404259)
    to_i(Fixnum)          0.057835   0.000000   0.057835 (  0.057880)
    to_i(Fixnum) hex      0.060721   0.000000   0.060721 (  0.060781)
    read_varint(Bignum)   0.746133   0.000000   0.746133 (  0.746188)
    to_i(Bignum)          0.161963   0.000000   0.161963 (  0.162013)
    to_i(Bignum) hex      0.057992   0.000000   0.057992 (  0.058050)
    ---------------------------------------------- total: 6.397276sec
    
                              user     system      total        real
    loop                  0.013085   0.000000   0.013085 (  0.013042)
    to_varint(Fixnum)     0.471418   0.000000   0.471418 (  0.471432)
    to_s(Fixnum)          0.063889   0.000000   0.063889 (  0.063920)
    to_s(Fixnum) hex      0.063932   0.000000   0.063932 (  0.064852)
    to_varint(Bignum)     1.161453   0.000000   1.161453 (  1.161457)
    to_s(Bignum)          1.494447   0.000000   1.494447 (  1.494443)
    to_s(Bignum) hex      0.798755   0.000000   0.798755 (  0.798801)
    read_varint(Fixnum)   0.578633   0.000000   0.578633 (  0.387029)
    to_i(Fixnum)          0.060297   0.000000   0.060297 (  0.060339)
    to_i(Fixnum) hex      0.059738   0.000000   0.059738 (  0.059775)
    read_varint(Bignum)   0.976240   0.000000   0.976240 (  0.785603)
    to_i(Bignum)          0.177357   0.000000   0.177357 (  0.177371)
    to_i(Bignum) hex      0.057640   0.000000   0.057640 (  0.057644)
Commits on Oct 22, 2009
  1. Use the new managed libtommath

    Evan Phoenix authored
  2. GC performance tweeks

    Evan Phoenix authored
Commits on Oct 17, 2009
  1. @dbussink
Commits on Oct 1, 2009
Commits on May 11, 2009
  1. Start of new LLVM JIT

    Evan Phoenix authored
Commits on May 1, 2009
  1. Made UnMarshaller::get_*_varint() work on 64 bit systems.

    Tilman Sauerbeck authored
Commits on Apr 23, 2009
  1. @brixen
Commits on Apr 19, 2009
  1. Removed support for arrays from the RBC (un)marshaller.

    Tilman Sauerbeck authored
    These days we only write tuples but not arrays.
Commits on Apr 17, 2009
  1. Reworked the RBC format.

    Tilman Sauerbeck authored
    We now use a binary format for RBC files. Tags and strings are no longer
    delimited by a newline character and integers are encoded in a variable
    number of bytes.
    
    This results in much smaller RBC files that can be decoded faster.
Commits on Apr 13, 2009
  1. Removed unused C++ Marshaller class.

    Tilman Sauerbeck authored
Commits on Mar 21, 2009
  1. Don't zero the full buffer in UnMarshaller::get_int().

    Tilman Sauerbeck authored
    Instead, just make sure that the buffer is terminated at all.
  2. Document that Bignum::into_string always terminates the given buffer.

    Tilman Sauerbeck authored
    Make use of that in Marshaller::set_bignum by removing the unneeded
    memset() call.
Commits on Jan 9, 2009
  1. @brixen

    Fix marshalling float values.

    brixen authored
  2. @brixen
Commits on Oct 19, 2008
  1. @rue
Commits on Oct 18, 2008
  1. @rue

    Changed all OBJECT, SYMBOL, FIXNUM, INTEGER to normal syntax.

    rue authored
    * I.e., s/OBJECT/Object*/ &c.
  2. @rue
Commits on Oct 6, 2008
  1. @dgtized
Something went wrong with that request. Please try again.