[ruby-cvs:57828] normal:r50680 (trunk): variable.c: avoid compatibility table with generic ivars

normal at ruby-lang.org normal at ruby-lang.org
Sat May 30 09:20:17 JST 2015


normal	2015-05-30 09:20:15 +0900 (Sat, 30 May 2015)

  New Revision: 50680

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50680

  Log:
    variable.c: avoid compatibility table with generic ivars
    
    This recovers and improves performance of Marshal.dump/load on
    Time objects compared to when we implemented generic ivars
    entirely using st_table.
    
    This also recovers some performance on other generic ivar objects,
    but does not bring bring Marshal.dump/load performance up to
    previous speeds.
    
    benchmark results:
    minimum results in each 10 measurements.
    Execution time (sec)
    name    trunk   geniv   after
    marshal_dump_flo        0.343   0.334   0.335
    marshal_dump_load_geniv 0.487   0.527   0.495
    marshal_dump_load_time  1.262   1.401   1.257
    
    Speedup ratio: compare with the result of `trunk' (greater is better)
    name    geniv   after
    marshal_dump_flo        1.026   1.023
    marshal_dump_load_geniv 0.925   0.985
    marshal_dump_load_time  0.901   1.004
    
    * include/ruby/intern.h (rb_generic_ivar_table): deprecate
    * internal.h (rb_attr_delete): declare
    * marshal.c (has_ivars): use rb_ivar_foreach
      (w_ivar): ditto
      (w_object): update for new interface
    * time.c (time_mload): use rb_attr_delete
    * variable.c (generic_ivar_delete): implement
      (rb_ivar_delete): ditto
      (rb_attr_delete): ditto
      [ruby-core:69323] [Feature #11170]

  Added files:
    trunk/benchmark/bm_marshal_dump_load_geniv.rb
    trunk/benchmark/bm_marshal_dump_load_time.rb
  Modified files:
    trunk/ChangeLog
    trunk/include/ruby/intern.h
    trunk/internal.h
    trunk/marshal.c
    trunk/time.c
    trunk/variable.c


More information about the ruby-cvs mailing list