babel-plugin-transform-react-binding
babel-plugin-transform-react-binding copied to clipboard
Benchmark!
trafficstars
So in theory this plugin is great. We prevent the breaking of purity throughout our components transparently so should be able to avoid lots of re-renders without having to manually manage our bound functions and their references.
However, there is obviously some performance cost from doing the memoized bind so it would be good to have some very clear benchmarks which would demonstrate this and allow us to decide whether the optimisation is worth it or not.
These benchmarks should help:
- Determine whether this is even a viable solution (though the work done here should be what we do in our components anyway to keep purity)
- Determine location (per instance? per component?) of cache and size (dynamic? best default static?)
- Prevent performance regressions in future releases and allow people to test different caching algorithms
I love this project's idea. Writing function in the render method is so easy to read.... I am not good at benchmarking, but I will study. Thanks.