As an AStar search progresses it makes new States at each iteration. When we handled transit within AStar, there was a lot of Transit-related data that didn't change from one State to the next. Many fields were pulled out into StateData object that would change less often. In OTP2 transit is handled by Raptor, so we need a lot fewer fields in AStar States.
We still plan to keep the State immutable, and use StateEditors (or Builders) to copy them. But we'll remove the two-tiered structure and just clone all the fields in the State.
So many fields have been removed that this new approach should still use less memory than the older approach.
As an AStar search progresses it makes new States at each iteration. When we handled transit within AStar, there was a lot of Transit-related data that didn't change from one State to the next. Many fields were pulled out into StateData object that would change less often. In OTP2 transit is handled by Raptor, so we need a lot fewer fields in AStar States.
We still plan to keep the State immutable, and use StateEditors (or Builders) to copy them. But we'll remove the two-tiered structure and just clone all the fields in the State.
So many fields have been removed that this new approach should still use less memory than the older approach.