Performance issue with UDP read using Parfeval in GUI

Hi ,
I have created a GUI with AppDesigner which creates a parfeval worker and runs my algorithm fucntion continousoly on it. My function reads the data from the uddport , reshapes it , processes it and sends it back into a dataQueue which is bound to 3 different afterEach calls.
The observations are as follows:
  • The pipeline is taking less than a second to process 1 seconds worth of data when run in serial (no parfeval)
  • The pipeline is taking less than 1 second to process 1 second's worth of simulated data (disabled udpport read) with parfeval in GUI
  • The pipeline is taking 5 seconds to process 1 second's data with UDP data with parfeval in GUI.
  1. Can you please let us know as to why the UDP read is taking so much time in the parfeval worker called inside a GUI? How would we fix this to improve upon the performance of the code?
  2. Is there any way to debug inside a function called on a parallel worker using parfeval?
Thanks and Regards,
Srinivasan B

3 Comments

How are you creating the UDP object?
In the test where you simulate receiving data, are you still creating the udp object?
(Just trying to narrow down possibilities)
Hi,
Thanks for the reply.
1.We are creating the udp object once inside the parfeval call.
2.When we simulated we are not creating the udp object we are giving dummy values to the size of the udp data output.
The udp object creation code snippet
client code:
f = parfeval(@algorithmPipeline)
Worker code:
function algorithmPipeline
initUDP() %initializing UDP once
while(1)
read udp data % Reading the data from UDP port
algorithm()
end
end
Thanks and Regards,
Srinivasan
The next step would be to simulate with creating the udp object, but without actually reading from it, substituting other data.
This will allow testing of the hypothesis that creation of the UDP object is slow.

Sign in to comment.

Answers (0)

Asked:

on 1 Oct 2021

Commented:

on 4 Oct 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!