@@ -94,6 +94,9 @@ pub fn generate_world_with_options(
9494 let progress_increment_prcs: f64 = 45.0 / elements_count as f64 ;
9595 let mut current_progress_prcs: f64 = 25.0 ;
9696 let mut last_emitted_progress: f64 = current_progress_prcs;
97+ let desired_updates: u64 = 500 ;
98+ let pb_batch_size: u64 = ( elements_count as u64 / desired_updates) . max ( 1 ) ;
99+ let mut element_counter: u64 = 0 ;
97100
98101 // Pre-scan: detect building relation outlines that should be suppressed.
99102 // Only applies to type=building relations (NOT type=multipolygon).
@@ -124,7 +127,10 @@ pub fn generate_world_with_options(
124127
125128 // Process all elements
126129 for element in elements. into_iter ( ) {
127- process_pb. inc ( 1 ) ;
130+ element_counter += 1 ;
131+ if element_counter. is_multiple_of ( pb_batch_size) {
132+ process_pb. inc ( pb_batch_size) ;
133+ }
128134 current_progress_prcs += progress_increment_prcs;
129135 if ( current_progress_prcs - last_emitted_progress) . abs ( ) > 0.25 {
130136 emit_gui_progress_update ( current_progress_prcs, "" ) ;
@@ -138,6 +144,11 @@ pub fn generate_world_with_options(
138144 element. kind( )
139145 ) ) ;
140146 } else {
147+ // Clear on every non-debug iteration so any transient warning
148+ // message set by downstream element processing (missing nodes,
149+ // etc.) doesn't stick for the rest of the run. The cost is
150+ // trivial — indicatif's set_message is just a mutex + string
151+ // compare (~20 ns), ~40 ms over a full world.
141152 process_pb. set_message ( "" ) ;
142153 }
143154
@@ -330,6 +341,7 @@ pub fn generate_world_with_options(
330341 // Element is dropped here, freeing its memory immediately
331342 }
332343
344+ process_pb. inc ( element_counter % pb_batch_size) ;
333345 process_pb. finish ( ) ;
334346
335347 // Drop remaining caches
0 commit comments