From: Joe Van Dyk Date: 2005-08-15T10:02:37+09:00 Subject: Re: no clue On 8/14/05, Ara.T.Howard wrote: > On Sun, 14 Aug 2005, Joe Van Dyk wrote: > > >> On Sun, 14 Aug 2005, Joe Van Dyk wrote: > > > Thanks! I shall study this code (there's a few new idioms that I > > haven't used before) and report back early next week on the > > performance improvements. > > try this one - it's another order of magnitude faster: > > > harp:~ > ruby a.rb > # > 400 > 1.0 > 42 > pid : 400, x_position : 1.0, y_position : 2.0, z_position : 3.0, foobar : 42 > creations per second : 114797 > > > harp:~ > cat a.rb > class PlayerData > class << self > def create(*a) > new(a.pack(FORMAT)) > end > end Why do you use 'class << self' here? Thanks, Joe