wesm/vbench — Issue #15: Auto-set Benchmark name from enclosing scope (if possible)
Author: wesm
Created: 2012-01-04 18:20:12+00:00
State: open
Labels: Enhancement

I have some DRY issues like this:

```
join_dataframe_index_multi = \
Benchmark("df.join(df_multi, on=['key1', 'key2'])", setup,
name='join_dataframe_index_multi',
start_date=datetime(2011, 10, 20))
```

I'm no fan of AST hacks but it would be pretty simple to grab the variable name from the statement responsible for creating the benchmark object. Obviously don't help if you're creating it as a key in a dict or something like that, would have to be an assignment.