- Home /
Performance problem in web request upgrading from Unity 5.3.4f1 to Unity 5.6.4f1
In my project I need to communicate with a local Web Server and in order to do that I fill a WWWForm and I send it with a WWW POST Request. I see that upgrading the project from Unity 5.3.4f1 to Unity 5.6.4f1, the time between the request to the local server and the response received from the server increase drammatically with Unity 5.6.4f1.
Following it's the source code used to test this problem:
while (true)
{
float frameTimeStamp = Time.realtimeSinceStartup;
WWWForm formData = new WWWForm();
formData.AddField("timeStamp", frameTimeStamp.ToString());
timer = System.Diagnostics.Stopwatch.StartNew();
WWW mWebRequest = new WWW(mURL, formData);
yield return mWebRequest;
timer.Stop();
Debug.Log("Millisecond for 1 requests: " + timer.Elapsed.TotalMilliseconds.ToString());
}
Running the code above in Unity 5.3.4f1 the console shows a time in the range [28 ms, 43ms], running it in Unity 5.6.4f1 the console shows a time in range [215 ms, 230ms].
Why does the time increase so much upgrading to Unity 5.6.f1 and how can I fix it?
Comment