You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* add `Metric` fused effect and re-export it from `Swarm.Effect` in utility library (moving Time effect)
* add `Swarm.Game.World.Metrics` module with `WorldMetrics` stored in `Landscape` state
* game.tile_loaded
* game.tile_in_memory
* game.tile_average_load_time
* game.tiles_batch_load_time
* add `loadRegionM` (and `loadCellM`) function that caches tile and updates metrics
* make World state use [`strict`](https://hackage.haskell.org/package/strict-0.5) pair and maybe types
* this makes the measurements meaningful but otherwise isn't a big change as the tile would be forced soon enough
This comes with the major caveat that only the time loading tiles by the world view in TUI is measured.
You can see the disparity in the graph:
```bash
cabal run swarm -- --seed 0 --scenario Creative --run <(echo 'build {require "boat"; turn south; let m = move; m in m}')
```
<img width="400" alt="Screenshot 2025-08-31 at 12 41 43 AM" src="https://github.com/user-attachments/assets/1a13a941-9c1d-4885-bc2e-ac06f0bc4b27" />
Adding effects to other world functions changes the type of few very common functions in Swarm Engine (e.g. structure recognizer) which were only using the `GameState`. I will do that in a follow up PR.
0 commit comments