Reduce RAM usage for generating mapping files
Right now a temporary array is used to correctly order elements and then write sequentially to the file. However this uses 2TB of RAM on the entire graph. Other solutions were tried in D1802 but they all were way to slow to be doable in practice.
Migrated from T1950 (view on Phabricator)