kivy/kivy — pull request #2533 by matham (2014-09-28 08:45:34+00:00)
Title: Optimize kv binding2

This is a rebase of https://github.com/kivy/kivy/pull/2368.

In the last commit, I replaced the binding methods to use a optimized linked list for storing the callbacks instead of the list. The reason is that, although binding and creation of complex widgets seemed faster with this branch, in the kivy.tools.benchmark, my branch was worse than master. After tinkering, the reason is that my branch add a slight cost for storing the largs. The cost of storing the largs < cost of partial, so for complex widgets that made use a lot of partial in lang.py my branch was fatser. But for simpler widgets, the added small cost of saving the largs dominated, hence the benchmark.

benchmark results:
---------------------------

https://gist.github.com/matham/f0becba89f249bc1455b shows the kivy.tools.benchmark.outcome as measured on my system.

The timeit benchmarks from the original pr is still pretty much the same. here's the retested values:

```
binding properties - __master__: 0.256174957224, pr: 0.111772918976
binding event - master: 0.01135848443, pr: 0.0102056007532
unbinding properties - master: 0.152547753701, pr: 0.012733191232
dispatching `boo0_in` - master: 0.0151368482948, pr: 0.0148598497711
```