parallel compilation

speedup compilation on multicore/multicpu machines(cherry picked from commit 33134feaa38a9fb376dea97eb7711cdd5aced758)