From: Robert Klemme Date: 2007-10-17T06:35:01+09:00 Subject: Re: Struct is slow On 16.10.2007 22:00, Wayne Magor wrote: > Mental Guy wrote: >> If type_arr[j] is a struct, then try type_arr[j].typedef_type >> rather than type_arr[j][:typedef_type], and see if that makes >> a difference. > > Well, I tried it and, as expected, the syntax change made no difference. > The one with Struct's still takes 27 seconds and doesn't work correctly. > It's not clear to me why it should be different than just using a > 2-element array (shrug). Did you actually also use the same block call semantics? L546 type_arr.each do |x| print(x[:typedef_type], "\t\t", x[:typedef_name], "\n") R547 type_arr.each do |typedef_type, typedef_name| print(typedef_type, "\t\t", typedef_name, "\n") Make the latter R547 type_arr.each do |x| print(x.typedef_type, "\t\t", x.typedef_name, "\n") Where x is your struct type. robert