Bash

git add builder/src/build_index.cpp && git commit -m "$(cat <<'EOF'
perf: eliminate hash lookups and small writes in index file generation

Three optimizations to the write phase:
1. write_entries returns positional offset vector (O(1) lookup by index)
   instead of unordered_map (O(1) amortized but poor cache locality)
2. geo_cells.bin built in a single memory buffer using array indexing
   instead of 332M × 3 hash map lookups + 332M × 4 small writes
3. Entry files built in memory buffer then written in single call

On planet data (332M cells), this eliminates ~2 billion hash map lookups
and reduces syscalls from ~1.3 billion to ~20.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
EOF
)" && cat builder/src/build_index.cpp | ssh node3 "cat > /tmp/traccar-geocoder/builder/src/build_index.cpp" && ssh node3 "cd /tmp/traccar-geocoder/builder/build && make -j\$(nproc) 2>&1 | tail -3" 2>&1

Commit, upload, build


[main 084677b] perf: eliminate hash lookups and small writes in index file generation
 1 file changed, 52 insertions(+), 21 deletions(-)
      |           ^~~~~~~~
[100%] Linking CXX executable build-index
[100%] Built target build-index


Let me test on Germany first for a quick validation, then planet.


ssh node3 "rm -rf /tmp/de-fast && mkdir -p /tmp/de-fast && /tmp/traccar-geocoder/builder/build/build-index /tmp/de-fast ~/pbf/germany.osm.pbf --parallel-admin 2>&1 | grep -E '\\[.*s\\]|polygon|Done'" 2>&1

Germany test with optimized writes


  Added 37 admin polygons from closed ways.
  Assembling admin polygons in parallel (40080 relations, 112858 way geometries)...
  Parallel admin assembly complete: 43186 polygon rings from 40080 relations.
Done reading:
  43223 admin polygon rings
Waiting for admin polygon S2 covering to complete...
Admin polygon S2 covering complete (6103 cells).
admin index: 6103 cells, 43223 polygons
Done.


Hmm, no timer output. The PHASE_START/PHASE_LOG macros are only on the osmium-segment-assembler branch. Let me add them to main too.


No matches found


Right — timers are only on the branch. Let me cherry-pick just the timer additions, or add them fresh. Quick add: