@stloyd well, you're right, I performed following benchmark https://gist.github.com/jfsimon/33480ec6ade7820bb313 and your solution is better than mine! I update the PR.