Skip to content

perf: cache schedule-shaped simulation routes - #104

Merged
adot-7 merged 1 commit into
mainfrom
ao/metroshell-67/root
Aug 13, 2026
Merged

perf: cache schedule-shaped simulation routes#104
adot-7 merged 1 commit into
mainfrom
ao/metroshell-67/root

Conversation

@adot-7

@adot-7 adot-7 commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Closes #101

Summary

  • precompute immutable schedule timing and cumulative shape geometry during GTFS indexing
  • cache active simulation routes by feed generation, Delhi service date, and acceleration configuration
  • invalidate on feed reload/error/missing transitions and service/date/config changes without crossing no-service boundaries
  • add deterministic cache counters, cache-vs-uncached equivalence tests, and extracted-feed/render benchmarks

Diagnosis and measurements

Against read-only /home/adot/projects/golearning/metroshell/mapdata/extracted on AMD Ryzen 7 8845HS:

  • baseline route rebuild: ~9.32 ms/op, 3.68 MB/op, 623 allocs/op (prior temporary benchmark)
  • current BenchmarkUncachedExtractedRoutes: 266,258 ns/op, 1.34 MB/op, 143 allocs/op
  • current BenchmarkCachedExtractedRoutes: 1,406 ns/op, 16 B/op, 1 alloc/op
  • current BenchmarkUncachedExtractedSnapshot: 968,159 ns/op, 1.34 MB/op, 175 allocs/op
  • current BenchmarkCachedExtractedSnapshot: 22,968 ns/op, 7,752 B/op, 33 allocs/op
  • render benchmarks: normal ~65 us/op; wide ~207 us/op (10 iterations)

Verification

gofmt, go test ./..., go vet ./..., go build ./..., and git diff --check pass.

@adot-7
adot-7 force-pushed the ao/metroshell-67/root branch from f4a4825 to 69767c6 Compare August 13, 2026 13:40
@adot-7
adot-7 merged commit 7d94fc1 into main Aug 13, 2026
1 check passed
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.

Fix: restore render responsiveness after schedule-shaped motion

1 participant