luislavena/bench-micro — pull request #5 by patriciomacadden (2014-01-04 03:52:25+00:00)
Title: Add benchmarks about the amount of allocated objects

Hi @luislavena!

I added a lot of stuff in this commit. I know I should have split it into separated commits so I can do it if you want.

This is what I did:

* Added benchmarks for the amount of allocated objects. I copy pasted your gist and added `stats.allocations.all.size` as the total amount of allocated objects. Not sure if this is the best way, but it gives me the same results.
* Added the results in the README (copy pasted the `## How?` section)
* Created an `apps` directory, which holds the applications being used by the benchmarks.

And this is what I want to add in the future:

* Create a `bench_requests` directory for the current `.ru` files, so each benchmark files are in their own directory. This is very simple, but I wanted to know if you agree.
* Show how many bytes are allocated, not just the amount of objects. I don't know if this is possible, but it's a nice add-on.
* Find a nice solution for running the benchmarks in an automated fashion, but for now I used something like this for getting the results:

```bash
for i in `ls *.ru`; do
echo $i: `bundle exec ruby $i | sed '2,$d' | sed 's/total allocations: //g'`
done
```

Comments are appreciated!

/cc @guilleiguaran

PS: I'm going to be offline this weekend, so be patient until I come back!