Virtus is 20+ times slower to instantiate an object from a hash than using a Plain Old Ruby Object or Struct.
If this process involves parsing timestamps into Time objects Virtus is then only 2 times slower.
We are talking 0.00001 ms vs 0.000005 ms to instantiate an object here. In the context of handling an http request in a rails app, I believe that the performance impact is non existent.
Calculating ------------------------------------- Dup and update 1.728k i/100ms PORO 1.695k i/100ms Struct 1.760k i/100ms Virtus 928.000 i/100ms
Dup and update 18.171k (±15.5%) i/s - 89.856k
PORO 17.772k (±12.4%) i/s - 88.140k
Struct 18.479k (±13.8%) i/s - 91.520k
Virtus 9.254k (±11.5%) i/s - 46.400k
Calculating ------------------------------------- Dup and update 44.825k i/100ms PORO 36.665k i/100ms Struct 72.831k i/100ms Virtus 2.596k i/100ms
Dup and update 686.871k (±15.7%) i/s - 3.362M
PORO 427.578k (±26.1%) i/s - 1.980M
Struct 1.222M (±20.2%) i/s - 5.826M
Virtus 20.415k (±26.8%) i/s - 90.860k