lml / lev

Ride the rails but don't touch them.
MIT License
2 stars 6 forks source link

Replace Hashie::Mash with OpenStruct #61

Closed Dantemss closed 5 years ago

Dantemss commented 6 years ago

Not really needed for anything, just nice to have for performance reasons.

Dantemss commented 5 years ago

I'm closing this PR because OpenStruct is not always faster than Hashie::Mash. In fact, lev routine outputs are often set but not read, which I think favors Hashie::Mash, according to those (somewhat old) benchmarks:

http://jgaskins.org/blog/2014/12/20/hashie-vs-openstruct-vs-poros

Ideally we would do something similar to https://github.com/lml/lev/pull/46 which allows outputs to be declared ahead of time. But if we do that we should probably use a Struct instead. See benchmarks in:

https://www.honeybadger.io/blog/how-openstruct-and-hashes-can-kill-performance/