Improved performance of some common2 code

Test Plan: Compiled, ran a program which uses this. Ran make test

Reviewers: pad, julienv

Reviewed By: pad

Differential Revision: https://phabricator.fb.com/D763600

Task ID: 2253460