Currently, if emerge is invoked on a squashfs based livecd, it will spend a lot of time to regenerate the entire vdb_metadata.pickle. This is due to truncation of timestamps to 1s precision. If the vdb_metadata.pickle code would detect this truncation, then it could treat the cache as valid, and avoid regenerating it.
There's a patch in the following branch: https://github.com/zmedico/portage/tree/bug_564222
The first version of the patch had incorrect logic. It's fixed now. Here's a link to the current patch: https://github.com/zmedico/portage/commit/ca8505cf52354c0ac3b1feb1900dc034658072b0.patch
I've posted the patch for review here: https://archives.gentoo.org/gentoo-portage-dev/message/3c7fa054f5af9d8399c03e08d049f6e0
I gave report on irc but I'll add it here as well. This patch speed up the initial run of emerge on my livecd by EIGHT minutes. Please accept it.
This is in the master branch: https://gitweb.gentoo.org/proj/portage.git/commit/?id=9e282e5ef9918264647d114290f59323d21e29a6
Fixed in 2.2.24.