Closed ANIALLATOR114 closed 3 days ago
This pull request optimizes the performance of the realtime_service.py file by replacing linear searches with dictionary lookups. The changes focus on improving the efficiency of processing realtime updates for trip schedules.
sequenceDiagram
participant Client
participant Service
participant Dict
Client->>Service: Request realtime schedules
Service->>Dict: Create lookup dictionary
Service->>Dict: Lookup trip by ID
Dict-->>Service: Return matching trip
Service->>Client: Return realtime schedules
Change | Details | Files |
---|---|---|
Optimize trip_id lookup in parse_most_recent_realtime_update function |
|
SimplyTransport/domain/services/realtime_service.py |
Improve performance in get_realtime_schedules_for_static_schedules function |
|
SimplyTransport/domain/services/realtime_service.py |
Summary by Sourcery
Enhance the performance of the realtime service by replacing list iterations with dictionary lookups for more efficient data retrieval.
Enhancements: