Now add sub-timers to the write phase too. Let me find it.


Grep

Write entry files in parallel|Build geo_cells|admin_future|Wait for all parallel


1800:        // Write entry files in parallel (returns positional offset vectors, not hash maps)
1819:        // Build geo_cells.bin in memory buffer (avoids 332M × 4 small writes + hash lookups)
1848:    auto admin_future = std::async(std::launch::async, [&] {
1896:    // Wait for all parallel writes
1897:    admin_future.get();


  1795→            }
  1796→            sorted_geo_cells.assign(all_geo_cells.begin(), all_geo_cells.end());
  1797→            std::sort(sorted_geo_cells.begin(), sorted_geo_cells.end());
  1798→        }
  1799→
  1800→        // Write entry files in parallel (returns positional offset vectors, not hash maps)
  1801→        std::vector<uint32_t> street_offsets, addr_offsets, interp_offsets;
  1802→        {
  1803→            auto f1 = std::async(std::launch::async, [&]() {
  1804→                return write_entries(output_dir + "/street_entries.bin", sorted_geo_cells, data.cell_to_ways);
  1805→            });
  1806→            if (write_addresses) {
  1807→                auto f2 = std::async(std::launch::async, [&]() {
  1808→                    return write_entries(output_dir + "/addr_entries.bin", sorted_geo_cells, data.cell_to_addrs);
  1809→                });

            }
            sorted_geo_cells.assign(all_geo_cells.begin(), all_geo_cells.end());
            std::sort(sorted_geo_cells.begin(), sorted_geo_cells.end());
        }

        // Write entry files in parallel (returns positional offset vectors, not hash maps)
        std::vector<uint32_t> street_offsets, addr_offsets, interp_offsets;
        {
            auto f1 = std::async(std::launch::async, [&]() {
                return write_entries(output_dir + "/street_entries.bin", sorted_geo_cells, data.cell_to_ways);
            });
            if (write_addresses) {
                auto f2 = std::async(std::launch::async, [&]() {
                    return write_entries(output_dir + "/addr_entries.bin", sorted_geo_cells, data.cell_to_addrs);
                });


Edit

        // Write entry files in parallel (returns positional offset vectors, not hash maps)
        std::vector<uint32_t> street_offsets, addr_offsets, interp_offsets;

        // Write entry files in parallel (returns positional offset vectors, not hash maps)
        auto _wt = std::chrono::steady_clock::now();
        std::vector<uint32_t> street_offsets, addr_offsets, interp_offsets;