Struct vs. OpenStruct benchmark

In Ruby, data can be encapsulated in a various ways. For example with Classes, but also with Hashes, Structs and OpenStructs, depending on the use case.
In case of simple data containers without any logic, Hashes are typically used. But Classes are the tool of choice as soon as logic has to be bound to the data. Somewhere in between there are Struct and OpenStruct. However, accessing the data is almost equally comfortable.
But what about the performance perspective?

Assertion

The instantiation of simple data containers (such as Hashes) should be faster than the instantiation of more complex Classes.
A benchmark test is meant to prove the assertion. First, the instantiations:Struct

Benchmarks

The benchmarking Gem of choice is * benchmark-ips *. It measures the number of iterations per second. In addition, the Ruby Garbage Collector (GC) can be disabled during the benchmark.
The benchmark script:

Obviously the instantiation of Structs requires the least resources. In the same time, approximately 60% more Struct objects can be instantiated than Hashes. Struct is even faster than Class by the factor 3.5.

Conclusion

When it comes to performance, Struct is the winner. Hash as data container is also still with good performance. Classes should be used when creating objects that contain more extensive logic.
OpenStruct is, on the other hand, more suitable for prototyping, but less for high-performance instantiation of massive objects.