intridea/grape-entity — pull request #76 by justfalter (2014-06-11 18:34:43+00:00)
Title: Improve performance for serialization of entities

Hi there,

I spent a little bit of time profiling grape-entity using [ruby-prof](https://github.com/ruby-prof/ruby-prof), and found a couple of ways to improve performance during the serialization process. This changeset sees Grape::Entity serializing ~2.5 times faster, by my benchmark.

Before:
```
$ bundle exec ruby bench/serializing.rb
user system total real
serializing 1.800000 0.000000 1.800000 ( 1.800179)
```

After:
```
$ bundle exec ruby bench/serializing.rb
user system total real
serializing 0.750000 0.000000 0.750000 ( 0.751563)
```