
Issue #19693 has been updated by byroot (Jean Boussier). Status changed from Open to Closed Should we close? I don't see anything actionable here. ---------------------------------------- Misc #19693: Data initialization is significantly slower than Struct https://bugs.ruby-lang.org/issues/19693#change-103304 * Author: janosch-x (Janosch Müller) * Status: Closed * Priority: Normal ---------------------------------------- Maybe there is potential to make it as fast as Struct? ```ruby require 'benchmark/ips' S = Struct.new(:a, :b, :c, :d, :e, :f, :g, :h, :i, :j) D = Data.define(:a, :b, :c, :d, :e, :f, :g, :h, :i, :j) Benchmark.ips do |x| x.report('Struct') { S.new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) } x.report('Data') { D.new(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) } x.compare! end; 1 # => [...] # => Struct: 6916530.4 i/s # => Data: 1507259.5 i/s - 4.59x slower ``` -- https://bugs.ruby-lang.org/