Data processing for departure lists

Last week was all about finally getting the app to show the next departures for a given stop. The data I want to show is there, easily accessible, in the source data dumps I get but I need to rearrange and pack everything pretty dramatically to make it smaller. Consequently, when I want to display the data I have to reverse that, I have to unpack the data again – but only the small bit that I need – to be able to display it. The images show basically what the sequence has been to implement the unpacking: I look at the original data dump to know what the list of departures is supposed to look like. Then I write a test that captures that. Then I look at the compressed data in the database to figure out how to unpack it and whether anything’s missing that I need. Then the last step is to present the result in the app.

I’m taking some shortcuts right now – I display the wrong time and I show some departures that shouldn’t be there – but fixing that is the relatively easier part. 

What’s harder to fix is that it’s really slow, as the video below shows, there are long pauses especially immediately after the app starts (it gets faster over time). Also these are small stops, I don’t date click on a large station. Right now I want to display the correct data and only then look into fixing the slowness, probably after christmas. I want this to be lightning fast since I expect listing the next departures from a stop will be a super common operation.