Static QueryGraph for Sliding Window Map Matching improving performance

I’m working on an Android Java app that requires offline map matching of the car position as the car moves, like any GMaps or Uber app.
To do so, I call com.library.mapmatching.algorithm.MapMatching.doWork repeatedly with a sliding gpxList of Observations: each time the car moves, a new gpx is added to the list and the oldest is deleted.
This approach works, but it is too slow, as all the TransitionProbabilities corresponding to the gpxList need to be recalculated in each call and it is too time consuming.
To avoid 90% of all these repeated calculations and improve hugely the performance of this usual case, I would need to keep the last TransitionProbabilities cached. This needs that the VirtualEdges and VirtualNodes created from the gpxList keep the same IDs from one call to the next when they are the same.
This implies modifying QueryGraph.create and consequently QueryOverlayBuilder & QueryOverlay and keeping VirtualEdges and VirtualNodes static from one call to the next so that the previously created IDs are reused.
I don’t find any work related to this performance issue.
Has any work been done that could be used as a base point?
Or any other approach to this problem that I’m not seeing?
Anybody interested in working on this issue?

I’m not sure this is the easiest way to do this. Can you not cache the transition probabilities based on the gpx coordinates?

Yes, I can cache the transition probabilities based on the gpx coordinates, but the computeTransitionProbabilities method modifies the timeStep by adding the transitionProbablility and the PATH.
And the path is a list of edgesIds that could have virtual edges with different IDs than the cached ones.
So I come to the same problem, that I would need to keep VirtualEdges and VirtualNodes created from the gpxList keep the same IDs from one call to the next when they are the same.
Correct? Or am I missing something? Thanks

And in fact most of the time is consumed in the calcPath method so caching only the transitionProbability doesn’t help. I need to cache the path from FromTimeStep to ToTimeStep and to do it I think I need VirtualEdges and VirtualNodes created from the gpxList to keep the same IDs from one call to the next, unless I’m understanding something wrongly.

@easbar am I getting something wrong? Can I avoid the need of using previous edgeIds somehow?