TouchDesigner lags when fetching live sensor data from API

Hey everyone,
I’m running into a performance issue with my project and hoping to get some advice.

I have a setup where I’m fetching live data from an API and using that data to control turbulence movement in a particlegpu operator. The fetching and table creation works fine, but every time new data is fetched, TouchDesigner stutters or freezes for 1–3 seconds, with FPS dropping to 0.

My questions are:

  1. should I be using the Web Client DAT instead of Python urllib/requests?
  2. does fetching data in python block the main thread in TD?
  3. would it make more sense to fetch the data outside TD and push it in via OSC or TCP?
  1. yes, because of 2.
  2. yes. Any python action that “waits” will stall the main process until it is resolved. You can circumvent this by using TD_AsyncIO, Thread (and the new ThreadManager) or by using native TD workflow.
  3. Thats quite a lof of work for something doable in TD in a non blocking fashion. it can make sense for some things, but as long as something is only IO blocked this does not make sense.

TD_AsyncIO seem to have fixed my issues. Thank you very much, you have no idea how long ive been scatching my head over this :rofl: