[This PR](https://goo.gl/jScr2K) was never merged. It seems to improve performances by 20-25%. Perhaps we could open a new branch with this change and compare.