I am building a web application with wslink + vtk (python wrapper).
I am rendering a fairly big model on the server, everything starts smooth and the model renders correctly with an acceptable number of FPS.
After just utilising rotating it around the performance starts to drop and everything on the server gets very slow. Every message any new request is now much slower and it never recovers.
Is there a cache being created that could be cleaned? I am not sure what I can pursue here.
I already am setting interactive ratios and interactive quality but the key thing is the more events I send (using mouse interactions) over time the slower it gets, and it never recovers.
I think it might be related to vtkWebMouseHandler and vtkWebPublishImageDelivery in VTK protocols.
I am not sure if this is the only problem or the one causing, but it seems that the action property on the event is always down which in turn creates a StartInteractionEvent multiple times before calling finally EndInteractionEvent.
I’ve noticed that viewsInAnimation does not get cleared as intended, or at least to my level of understanding. It seems that we push the same viewId over and over to the viewsInAnimation array until it gets cleared only 1 times on the end event.
This after some time from my understanding is causing degradation in the streaming protocol.
I am not 100% sure on how the code works so it could be on purpose but it seems like this is causing a leak which in turn forces more renderings than necessary.
Again without knowing 100% of the code I think the vtkRemoteView with its interactorStyle vtkInteractorStyleRemoteMouse sends Start and End events correctly on it’s own, i.e. StartInteractionEvent and EndInteractionEvent. So it could be that without this bit:
if event["action"] == "down":
self.getApplication().InvokeEvent("StartInteractionEvent")
if event["action"] == "up":
self.getApplication().InvokeEvent("EndInteractionEvent")
in
class vtkWebMouseHandler(vtkWebProtocol):
@exportRpc("viewport.mouse.interaction")
def mouseInteraction(self, event):
is actually irrelevant and in this case causing the leak, but I’m not sure if it’s being used elsewhere, what I know here is that action is always down until it is up thanks to the way the interactor is created: