ipython/ipython — pull request #2246 by minrk (2012-08-03 23:38:09+00:00)
Title: serialize individual args/kwargs rather than the containers

This allows specials to be handled inside containers as args/kwargs

It is less efficient than before (still more efficient than 0.13) in cases where there is a very large number of simple arguments, but I think that generally the number of arguments is modest, and simple cases of small containers of arrays/References are likely (as most readily demonstrated by use in map).

The relevant behaviors are tested.

closes #2239

By the way, here's a plot showing why the new serialization had to be done:

![figure](https://img.skitch.com/20120804-gqm38wsie2gi4yfnh47mnt5x8f.png)

So about 100x faster for returning a 10k element list

It is the output from:

```python
f = lambda n: range(n)
view = rc[-1]

for p in range(20):
time.sleep(1)
n = 2**p
print "%i elements" % n
%timeit view.apply_sync(f, n)
```