Skip to content

Conversation

@bloom256
Copy link
Collaborator

@bloom256 bloom256 commented Feb 4, 2026

Overview

This PR removes the recently introduced bucket linking optimization.

While bucket linking provided a modest speedup (~5%) for small sliding windows, it introduces a linear linking pass over all indoor buckets and only works for integer indoor/outdoor bucket ratios. For presets with very large sliding windows (notably "Precise Forestry", 10 km), this leads to a performance regression as bucket maps become large and linking cost dominates.

To avoid preset-dependent behavior and reduce code complexity, bucket linking is removed entirely in favor of the simpler hash-based lookup path.

Related issue: #339


Changes

  • Removed bucket linking logic (coarser_bucket and related helpers)
  • Removed pointer-based outdoor bucket access
  • Restored hash-map lookup for outdoor buckets in all cases
  • Added a few small UTL profiler markers to make this code path easier to analyze

Impact

  • Fixes performance regression in "Precise Forestry"
  • Simplifies code and removes fragile special-case logic
  • Accepts ~5% slowdown for small-window presets in exchange for stable behavior across all configurations

Notes

Bucket linking was designed for typical small sliding windows but does not scale to large-window presets and adds complexity for a relatively small gain. Removing it avoids future regressions and keeps behavior consistent across presets.

@bloom256 bloom256 changed the title Fix: Remove bucket linking to avoid regression in "Precise Forestry" prese Fix: Remove bucket linking to avoid regression in "Precise Forestry" preset Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant