Skip to content

perf(search): Cache building list at startup to speed up search#82

Open
SiddhantBhirud wants to merge 2 commits intomaizebus-2.1from
42-have-full-building-list-be-downloaded-at-install-instead-of-every-time-the-search-feature-is-used
Open

perf(search): Cache building list at startup to speed up search#82
SiddhantBhirud wants to merge 2 commits intomaizebus-2.1from
42-have-full-building-list-be-downloaded-at-install-instead-of-every-time-the-search-feature-is-used

Conversation

@SiddhantBhirud
Copy link
Copy Markdown
Member

Description

Previously, the building list was fetched from the backend every time the search button was tapped. Now it is cached at startup in a global variable and reused in the search sheet, making search snappy.

Type of Change

  • New feature (feat)
  • Bug fix (fix)
  • Refactor / code improvement
  • Dependency / build update
  • Documentation
  • Other (explain)

Changes Made

  • Flutter:
    • Added globalBuildingLocs to globals.dart to cache buildings in memory
    • Updated _loadStopsForLaunch in map_screen.dart to fetch buildings at startup
    • Updated search_sheet_main.dart to use cached data instead of fetching on every search

Testing Done

Flutter:

  • Tested on:
    • iOS Simulator
    • Android Emulator
    • Physical device

Checklist

  • Commit messages follow Conventional Commits
  • PR title follows [type](scope): short description
  • PR target branch is not main and is our current working update branch
  • No print() / debugPrint() / console.log() left in production code
  • Secrets / keys not committed

…very search

Previously the building list was fetched from the backend every time the search button was tapped. Moved the fetch to app startup and stored it in a global variable, reusing it in the search sheet to make search instant.
@SiddhantBhirud SiddhantBhirud changed the base branch from maizebus2 to maizebus-2.1 March 31, 2026 00:05
@SiddhantBhirud SiddhantBhirud changed the title 42 have full building list be downloaded at install instead of every time the search feature is used Cache building list at startup to speed up search Mar 31, 2026
@SiddhantBhirud SiddhantBhirud changed the title Cache building list at startup to speed up search perf(search): Cache building list at startup to speed up search Mar 31, 2026
@kurz3m3 kurz3m3 self-requested a review April 2, 2026 00:19
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