For me the crux of this proposal is:
When a field named “strict” exists in the FeedHeader message, each TripUpdate message shall include a StopTimeUpdate message for every planned or already visited stop on the corresponding trip. Each of these StopTimeUpdate messages shall include both an arrival and departure StopTimeEvent."
Like this I think it would a great proposal and would be in favour of it and here is why:
My JVM could be running for a few weeks and then suddenly crash with an out of memory error. It would have had plenty of memory for a long time but then something happened to cause resource issues. User triggered usage is consistent (and low) and I don't think this is the problem. I've noticed that a JVM consumes 5%-7% of the CPU (even without external traffic) and most of this is almost certainly down to processing of TripUpdates.
I've reexamined my TripUpdate implementation and even if a producer does provide StopTimeUpdates for all stops on a trip I don't know that (they haven't told me so I can't assume so). If sequence numbers are contiguous from the start sequence (e.g. 10,11,12, etc) all the way up to the last stop sequence number then I don't have issues processing. But lets say they use sequence numbers 10,20,30 etc. When I process the StopTimeUpdate with a sequence number of 20 I've noted that the last one was 10. So for sequence numbers 11..19 I have to make a call to the database with the sequence number and trip id to see if it is a valid stop and return the stop id if it is. So depending on how the feed is produced you can see how this quickly becomes computationally expensive if there are a lot of trips with large gaps between the sequence numbers. When they are contiguous no database call is necessary in this case. And if there were gaps but Andrews strict flag was set to true then I wouldn't go looking for the missing sequence numbers as I would know they don't exist. Okay bad implementation you may say, but that is how it evolved. It would undoubtedly be better to get all stop sequences from the stop_times database table using the trip id and check against this for missing stops but it is still a database call.
And then when you get to the last StopTimeUpdate how do you know if it is the last stop of not. You don't so you have to find the max sequence number for that trip and compare. In strict mode this would not be necessary.
Additionally if the stop you are propagating from does not contain a delay, then you have to make a DB call to get the scheduled time, work out the delta between it and the estimated time and use this for propagation purposes.
The algorithm also needs to know not to propagate from a skipped stop so these StopTimeUpdates are not remembered for propagation purposes. Some of you may recall there was a previous discussion on whether or not to propagate skipped stops .
The main point is that in strict mode you don't have to worry about the complexities of propagation and code can be far simpler. I will still keep the code I have but strict allows most of the complex stuff be bypassed.
Hope this helps. "Strict" is probably something I will implement through a per feed configuration item anyway but then I have to gauge by examining a feed whether or not I think it is "strict". It would be more straight forward to have the feed itself tell me.
On Monday, 27 November 2017 23:25:41 UTC, Andrew Byrd wrote:.