It's unrealistic to compare WordPress php and Facebook php. Most website running WordPress do not need the optimization required to run facebook.
If there is something that slows down WordPress it's the database queries, the amount of external assets and bloated themes. There are more then files being downloaded for each requests and all served from the same server.
Throw in hhvm or any optimization on the code and you still have to deal with the other issues.