React - Improve performance by 6x
- 2x: The unminified version contains invariants that shouldn't be used in production and slow it down. - 3x: Adding a shouldComponentUpdate override in order to short-cut re-rendering the component when props and state didn't change. In order to do that, we need to avoid doing mutations by doing a shallow copy and only modifying what changed - When React 0.5.0 will be released, it will give another 1.5x. Other miscellaneous changes: - Update class="..." to className="..." to work in 0.5.0 (still works in 0.4.1) - Use prop="..." instead of prop='...' - Use filter(f, this) instead of filter(f.bind(this)) to prevent a function allocaton
Showing
Please register or sign in to comment