[ruby-core:66806] Re: [ruby-trunk - Feature #10585] struct: speedup struct.attr = v for first 10 attributes and struct[:attr] for big structs

From: Eric Wong <normalperson@...>
Date: 2014-12-12 10:42:48 UTC
List: ruby-core #66806
funny.falcon:

  I tried using khash fstring for Feature #10096 but benefits seemed
  minor.  I also worry about executable size getting bigger every
  release...  Maybe using Array storage + open address hash can save
  space (both runtime memory and execuatable size).

ko1:

  Feature #10575 was inspired by a private (crazy) project many years
  ago.  As a C programmer learning Ruby, I expected Ruby Struct to be
  similar to C struct and offer performance characteristics of an array.
  I had 200-500 member (auto-generated) Ruby Structs and noticed speed
  problems.  It was easier to rewrite Ruby code at the time (to use
  hashes or attr), so I rewrote my code and forgot about struct.c
  However, I still hope to spare others from having to learn VM
  internals or rewrite any Ruby code for consistent performance.

In This Thread

Prev Next