charliesome/fast_open_struct — pull request #4 by vmg (2013-04-08 20:29:23+00:00)
Title: They see me rolling. They hating.

Just for the lulz. Here's some predictable performance for both dynamic and static attribute assignment. Very light memory usage, no caching, no method cache invalidation. Everything goes through `method_missing`.

:p

```
20,000 instantiations:
user system total real
OpenStruct 0.510000 0.000000 0.510000 ( 0.504499)
FastOpenStruct 0.060000 0.000000 0.060000 ( 0.064769)

Dynamic attribute assignment:
user system total real
OpenStruct 0.850000 0.000000 0.850000 ( 0.855718)
FastOpenStruct 0.400000 0.000000 0.400000 ( 0.397706)

Dynamic attribute lookup:
user system total real
OpenStruct 0.470000 0.000000 0.470000 ( 0.479450)
FastOpenStruct 0.340000 0.000000 0.340000 ( 0.332896)

Attribute assignment:
user system total real
OpenStruct 0.870000 0.000000 0.870000 ( 0.879519)
FastOpenStruct 0.390000 0.000000 0.390000 ( 0.393802)

Attribute lookups:
user system total real
OpenStruct 0.480000 0.000000 0.480000 ( 0.485427)
FastOpenStruct 0.310000 0.000000 0.310000 ( 0.303149)
````