network.download performance problems (Windows simulator)

Are there known performance problems using network.download running on Windows simulator?  It takes over a minute to download a 65 MB file over 1Gbps unused LAN connection.  Switching to external CDN with 40 Mbps internet connection produces roughly the same result.  I’m using windows 8.1.

I’d love to see Corona staff comment on the above experience. Are there are any Corona / registry settings that can be tweaked to improve the situation?

Thank you.

I’m unaware of any tweaks that can be made to improve networking. The network.download() is just a wrapper around network.request() which on Windows is making Windows HTTP requests using the Internet Explorer controls. So make sure you’re not running through an unnecessary proxy or other things that might affect IE networking that Edge or other browsers may be ignoring.

Rob

Hi Rob,

I never had a proxy server running on my network.  The only exception were debugging proxies such as Fiddler that I didn’t even have installed at the time.  I checked the network settings an as expected no proxy servers were found there.  Also I was able to reproduce this problem on my laptop running Windows 8.1 as well.  Download speeds were the same as on my desktop. Is it possible for some kind of throttling to occur within the Corona engine?

Is Corona using Windows HTTP services?

https://docs.microsoft.com/en-us/windows/desktop/winhttp/winhttp-start-page

Thank you

I know Windows likes to set up its own proxy as part of it’s “Internet settings”. We are not intentionally throttling network connections that I’m aware of.

Can you produce a simple test app that shows your performance speeds and gives a baseline? I can certainly test it.  I don’t have any Windows 8.x machines anymore, but I can get comparisons on Windows 10 and macOS over a gigabit fiber connected connection.

You can upload a .zip file with the project in it and upload it to Google Drive or DropBox for me to look at.

Rob

Here’s the link to the test app:

https://drive.google.com/open?id=1XBbczmd7CnPI5YoTOzyVBZy2Cu4Jarja

I don’t think it would be intentional, but rather some development related code might have been accidentally left behind.  Below are the execution logs.  The speed in both cases appears to be nearly identical. Also downloads of the same files with IE or Firefox finish in an instant.

#1 A LAN server - 1 Gbps connection

Downloading file: 48.79 MB [17:13:52] 0.02% [17:13:53] 1.04% [17:13:54] 2.07% [17:13:55] 3.09% [17:13:56] 4.11% [17:13:57] 5.14% [17:13:58] 6.16% [17:13:59] 7.19% [17:14:0] 8.21% [17:14:1] 9.24% [17:14:2] 10.26% [17:14:3] 11.29% [17:14:4] 12.31% [17:14:5] 13.34% [17:14:6] 14.36% [17:14:7] 15.39% [17:14:8] 16.41% [17:14:9] 17.44% [17:14:10] 18.46% [17:14:11] 19.49% [17:14:12] 20.51% [17:14:13] 21.53% [17:14:14] 22.56% [17:14:15] 23.58% [17:14:16] 24.61% [17:14:17] 25.63% [17:14:18] 26.66% [17:14:19] 27.68% [17:14:20] 28.71% [17:14:21] 29.73% [17:14:22] 30.76% [17:14:23] 31.78% [17:14:24] 32.81% [17:14:25] 33.83% [17:14:26] 34.86% [17:14:27] 35.88% [17:14:28] 36.91% [17:14:29] 37.93% [17:14:30] 38.95% [17:14:31] 39.98% [17:14:32] 41.00% [17:14:33] 42.03% [17:14:34] 43.05% [17:14:35] 44.08% [17:14:36] 45.10% [17:14:37] 46.13% [17:14:38] 47.15% [17:14:39] 48.18% [17:14:40] 49.20% [17:14:41] 50.23% [17:14:42] 51.25% [17:14:43] 52.28% [17:14:44] 53.30% [17:14:45] 54.32% [17:14:46] 55.35% [17:14:47] 56.37% [17:14:48] 57.40% [17:14:49] 58.42% [17:14:50] 59.45% [17:14:51] 60.47% [17:14:52] 61.50% [17:14:53] 62.52% [17:14:54] 63.55% [17:14:55] 64.57% [17:14:56] 65.60% [17:14:57] 66.62% [17:14:58] 67.65% [17:14:59] 68.67% [17:15:0] 69.70% [17:15:1] 70.72% [17:15:2] 71.74% [17:15:3] 72.77% [17:15:4] 73.79% [17:15:5] 74.82% [17:15:6] 75.84% [17:15:7] 76.87% [17:15:8] 77.89% [17:15:9] 78.92% [17:15:10] 79.94% [17:15:11] 80.97% [17:15:12] 81.99% [17:15:13] 83.02% [17:15:14] 84.04% [17:15:15] 85.07% [17:15:16] 86.09% [17:15:17] 87.10% [17:15:18] 88.09% [17:15:19] 89.10% [17:15:20] 90.11% [17:15:21] 91.12% [17:15:22] 92.01% [17:15:23] 92.88% [17:15:24] 93.81% [17:15:25] 94.80% [17:15:26] 95.83% [17:15:27] 96.85% [17:15:28] 97.87% [17:15:29] 98.88% [17:15:30] 99.91% [17:15:30] Done Finished in : 1.64 min

#2 Local IIS server

Downloading file: 48.79 MB [17:16:22] 0.02% [17:16:23] 1.06% [17:16:24] 2.08% [17:16:25] 3.11% [17:16:26] 4.13% [17:16:27] 5.16% [17:16:28] 6.18% [17:16:29] 7.20% [17:16:30] 8.23% [17:16:31] 9.25% [17:16:32] 10.28% [17:16:33] 11.30% [17:16:34] 12.33% [17:16:35] 13.35% [17:16:36] 14.38% [17:16:37] 15.40% [17:16:38] 16.43% [17:16:39] 17.45% [17:16:40] 18.48% [17:16:41] 19.50% [17:16:42] 20.53% [17:16:43] 21.55% [17:16:44] 22.58% [17:16:45] 23.60% [17:16:46] 24.62% [17:16:47] 25.65% [17:16:48] 26.67% [17:16:49] 27.70% [17:16:50] 28.72% [17:16:51] 29.75% [17:16:52] 30.77% [17:16:53] 31.80% [17:16:54] 32.82% [17:16:55] 33.85% [17:16:56] 34.87% [17:16:57] 35.90% [17:16:58] 36.92% [17:16:59] 37.95% [17:17:0] 38.97% [17:17:1] 40.00% [17:17:2] 41.02% [17:17:3] 42.04% [17:17:4] 43.07% [17:17:5] 44.09% [17:17:6] 45.12% [17:17:7] 46.14% [17:17:8] 47.17% [17:17:9] 48.19% [17:17:10] 49.22% [17:17:11] 50.24% [17:17:12] 51.27% [17:17:13] 52.29% [17:17:14] 53.32% [17:17:15] 54.34% [17:17:16] 55.37% [17:17:17] 56.39% [17:17:18] 57.41% [17:17:19] 58.44% [17:17:20] 59.46% [17:17:21] 60.49% [17:17:22] 61.51% [17:17:23] 62.54% [17:17:24] 63.56% [17:17:25] 64.59% [17:17:26] 65.61% [17:17:27] 66.64% [17:17:28] 67.66% [17:17:29] 68.69% [17:17:30] 69.71% [17:17:31] 70.74% [17:17:32] 71.76% [17:17:33] 72.79% [17:17:34] 73.81% [17:17:35] 74.83% [17:17:36] 75.86% [17:17:37] 76.88% [17:17:38] 77.91% [17:17:39] 78.93% [17:17:40] 79.96% [17:17:41] 80.98% [17:17:42] 82.01% [17:17:43] 83.03% [17:17:44] 84.06% [17:17:45] 85.08% [17:17:46] 86.11% [17:17:47] 87.13% [17:17:48] 88.16% [17:17:49] 89.18% [17:17:50] 90.21% [17:17:51] 91.23% [17:17:52] 92.25% [17:17:53] 93.28% [17:17:54] 94.30% [17:17:55] 95.33% [17:17:56] 96.35% [17:17:57] 97.36% [17:17:58] 98.39% [17:17:59] 99.41% [17:18:0] Done Finished in : 1.63 min

Absolute blind guess on my side (as I haven’t used this myself at all) … maybe it’s just a result of a defined buffersize somewhere in the implementation and the actual framerate the app is running.

Not sure if it’s a good enough test, but you could try to set the fps in your config.lua to 30 and 60 and see if it makes any difference.

I don’t want to seem like a jerk here, but I can’t test this.  I get an error:

Aug 12 12:58:47.240 2018-08-12 12:58:47.239 Corona Simulator[17569:4139714] ERROR: network: network request failed: http://yourserver/path_to_your_test_file.zip [-1003: A server with the specified hostname could not be found.]

I can’t possibly reproduce your experience if I’m having to use my own servers, or guess at what content you’re trying to download. I can’t take up an engineer’s time to investigate this for the same reason. Their experience will be different than your’s because the project isn’t complete and we would have to guess at what you’re doing…

Please share a sample project, complete with the config.lua and build.settings you are using. If there is an option to download from a remote server, please use your server and the file you’re testing against. If you’re using a local http server on localhost, please include the file you’re trying to download along with the URL to the local host file. It would be very useful to provide a couple of UI buttons that start the various downloads.

Please provide a complete project that I can have an engineer unzip, run and see the issue without asking us to do any edits where possible.

Rob

I’ve updated the project.  You won’t have to change any URLs.  There are 3 file locations to choose from: Coronalabs server, Microsoft and NVIDIA.  The first 30MB docs file is sourced from Coronalabs and finishes in about a minute.

I also ran a test on my Windows 10 laptop and a Windows 7 VM.  In both cases the downloads were just as slow.  So that’s 4 machines in total now that exhibit this behavior.

https://drive.google.com/open?id=1I_TotW7DNjGWvh7kpC5cg6kX-tZUL9Ho

Thanks for the suggestion.  Unfortunately it didn’t work.

I’m conducting several tests. I’ll post my MacBook results in another post.

My network setup:  AT&T Fiber. I however am on WiFi and have a 250mbps download connection and 4ms ping times on an HP Envy Laptop running Windows 10. For the sample app, I commented out the progress, so I only get the “began” and “ended” phases printed.

Downloading https://developer.coronalabs.com/sites/default/files/corona/2018.3349/Corona-ApiDocs-2018.3349.zip via Google Chrome: 1:28 seconds.

In one run with the app in the simulator, I got this: 

20:30:53.093  Downloading file: 28.24 MB

20:31:51.373  [20:31:51] Done

20:31:51.373  Finished in : 0.97 min

That was 58 seconds. However a second run, I got worse times: 2 min 50 seconds.

21:22:26.338  Downloading file: 28.24 MB

21:25:16.496  [21:25:16] Done

21:25:16.496  Finished in : 2.84 min

Then from my MacBook Pro, with Google Chrome: 2 min, 32 seconds

I tried three times to run your app on my MacBook with the file from our servers. The first two runs produced:

Aug 12 09:48:11.337 Downloading file: 28.24 MB

Aug 12 09:49:14.816 [21:49:14] Done

                    Finished in : 0.04 min

Aug 12 09:52:23.279 Downloading file: 28.24 MB

Aug 12 09:57:04.491 [21:57:4] Done

                    Finished in : 0.11 min

That’s a 63 second download and 4+ minute download. I aborted the 3rd download because it was well over 7 minutes. Ironically, I had to abort downloads in the browser (on both platforms) several times because they were taking way too long.

Now to the IE file:

For: https://us.download.nvidia.com/Windows/398.82/398.82-notebook-win10-64bit-international-whql.exe

Google Chrome: 57 seconds.

With the test app, 1 min 58 sec.

21:33:27.608  Downloading file: 55.39 MB

21:35:22.371  [21:35:22] Done

21:35:22.371  Finished in : 1.91 min

Google Chrome on the Mac: 8 seconds

The test app: 7 seconds

Aug 12 09:45:55.399 Downloading file: 55.39 MB

Aug 12 09:46:02.693 [21:46:2] Done

Aug 12 09:46:02.693 Finished in : 0.04 min

I’m not going to do the 500mb file.  

So it does appear on Windows that the simulator is slower (though I do have one test that’s faster).  Let me jump to my MacBook and I’ll update this post for comparisons.

Here are my conclusions:

  1. We have an issue with our downloads. It doesn’t matter if I’m on a browser or your test app, sometimes I get similar quick speeds, sometimes I get horrible speeds. It’s not possible to identify issues with the network.download() API because the downloads are all over the place regardless of where the download is happening. I’ll report this to our system admins and have them investigate.

  2. With a very small sample size (one run each on Windows Chrome, App, MacBook Chrome, and App), there wasn’t any noticeable difference between the two Mac downloads and both were very quick.  On Windows, both downloads were significantly slower than the Mac, by nearly a 10:1 ratio or more. The App was twice as slow as the browser.  This could indicate a difference between the browser and the app, but with a sample size of 1, that’s going to be a difficult sell to our engineers.  

I’ll try on Windows some more tomorrow with the IE download and see if I can get a few more data points to see if it’s a transient network issue or an issue with the simulator. But on my MacBook, with the IE download there wasn’t much of a difference there.

Rob

Your first run matches mine very closely.  I think you reproduced it.  The second run is definitely due to the running over the Wifi.  If possible use wired connection for testing.  The bandwidth / latency jumps you experienced are pretty common with Wifi connections. I’ve tested on Mac OS and IOS.  The download speeds were much more reasonable and it looks like these platforms are not affected.

Downloading file: 28.24 MB [7:44:29] Done Finished in : 0.95 min

Thank you for taking the time to test

My Wifi is at least 250 megabits per second. That means I should be able to download a 25 megabyte file in one second between my router and my laptop. Since my hardwired connections are in the 950 megabit per second range, that file over my connection should take 0.25 seconds to transfer to me. Any time longer than that is overall Internet slowdowns, throttling or server’s being busy and having their bandwidth overwhelmed.

Rob

I’m unaware of any tweaks that can be made to improve networking. The network.download() is just a wrapper around network.request() which on Windows is making Windows HTTP requests using the Internet Explorer controls. So make sure you’re not running through an unnecessary proxy or other things that might affect IE networking that Edge or other browsers may be ignoring.

Rob

Hi Rob,

I never had a proxy server running on my network.  The only exception were debugging proxies such as Fiddler that I didn’t even have installed at the time.  I checked the network settings an as expected no proxy servers were found there.  Also I was able to reproduce this problem on my laptop running Windows 8.1 as well.  Download speeds were the same as on my desktop. Is it possible for some kind of throttling to occur within the Corona engine?

Is Corona using Windows HTTP services?

https://docs.microsoft.com/en-us/windows/desktop/winhttp/winhttp-start-page

Thank you

I know Windows likes to set up its own proxy as part of it’s “Internet settings”. We are not intentionally throttling network connections that I’m aware of.

Can you produce a simple test app that shows your performance speeds and gives a baseline? I can certainly test it.  I don’t have any Windows 8.x machines anymore, but I can get comparisons on Windows 10 and macOS over a gigabit fiber connected connection.

You can upload a .zip file with the project in it and upload it to Google Drive or DropBox for me to look at.

Rob

Here’s the link to the test app:

https://drive.google.com/open?id=1XBbczmd7CnPI5YoTOzyVBZy2Cu4Jarja

I don’t think it would be intentional, but rather some development related code might have been accidentally left behind.  Below are the execution logs.  The speed in both cases appears to be nearly identical. Also downloads of the same files with IE or Firefox finish in an instant.

#1 A LAN server - 1 Gbps connection

Downloading file: 48.79 MB [17:13:52] 0.02% [17:13:53] 1.04% [17:13:54] 2.07% [17:13:55] 3.09% [17:13:56] 4.11% [17:13:57] 5.14% [17:13:58] 6.16% [17:13:59] 7.19% [17:14:0] 8.21% [17:14:1] 9.24% [17:14:2] 10.26% [17:14:3] 11.29% [17:14:4] 12.31% [17:14:5] 13.34% [17:14:6] 14.36% [17:14:7] 15.39% [17:14:8] 16.41% [17:14:9] 17.44% [17:14:10] 18.46% [17:14:11] 19.49% [17:14:12] 20.51% [17:14:13] 21.53% [17:14:14] 22.56% [17:14:15] 23.58% [17:14:16] 24.61% [17:14:17] 25.63% [17:14:18] 26.66% [17:14:19] 27.68% [17:14:20] 28.71% [17:14:21] 29.73% [17:14:22] 30.76% [17:14:23] 31.78% [17:14:24] 32.81% [17:14:25] 33.83% [17:14:26] 34.86% [17:14:27] 35.88% [17:14:28] 36.91% [17:14:29] 37.93% [17:14:30] 38.95% [17:14:31] 39.98% [17:14:32] 41.00% [17:14:33] 42.03% [17:14:34] 43.05% [17:14:35] 44.08% [17:14:36] 45.10% [17:14:37] 46.13% [17:14:38] 47.15% [17:14:39] 48.18% [17:14:40] 49.20% [17:14:41] 50.23% [17:14:42] 51.25% [17:14:43] 52.28% [17:14:44] 53.30% [17:14:45] 54.32% [17:14:46] 55.35% [17:14:47] 56.37% [17:14:48] 57.40% [17:14:49] 58.42% [17:14:50] 59.45% [17:14:51] 60.47% [17:14:52] 61.50% [17:14:53] 62.52% [17:14:54] 63.55% [17:14:55] 64.57% [17:14:56] 65.60% [17:14:57] 66.62% [17:14:58] 67.65% [17:14:59] 68.67% [17:15:0] 69.70% [17:15:1] 70.72% [17:15:2] 71.74% [17:15:3] 72.77% [17:15:4] 73.79% [17:15:5] 74.82% [17:15:6] 75.84% [17:15:7] 76.87% [17:15:8] 77.89% [17:15:9] 78.92% [17:15:10] 79.94% [17:15:11] 80.97% [17:15:12] 81.99% [17:15:13] 83.02% [17:15:14] 84.04% [17:15:15] 85.07% [17:15:16] 86.09% [17:15:17] 87.10% [17:15:18] 88.09% [17:15:19] 89.10% [17:15:20] 90.11% [17:15:21] 91.12% [17:15:22] 92.01% [17:15:23] 92.88% [17:15:24] 93.81% [17:15:25] 94.80% [17:15:26] 95.83% [17:15:27] 96.85% [17:15:28] 97.87% [17:15:29] 98.88% [17:15:30] 99.91% [17:15:30] Done Finished in : 1.64 min

#2 Local IIS server

Downloading file: 48.79 MB [17:16:22] 0.02% [17:16:23] 1.06% [17:16:24] 2.08% [17:16:25] 3.11% [17:16:26] 4.13% [17:16:27] 5.16% [17:16:28] 6.18% [17:16:29] 7.20% [17:16:30] 8.23% [17:16:31] 9.25% [17:16:32] 10.28% [17:16:33] 11.30% [17:16:34] 12.33% [17:16:35] 13.35% [17:16:36] 14.38% [17:16:37] 15.40% [17:16:38] 16.43% [17:16:39] 17.45% [17:16:40] 18.48% [17:16:41] 19.50% [17:16:42] 20.53% [17:16:43] 21.55% [17:16:44] 22.58% [17:16:45] 23.60% [17:16:46] 24.62% [17:16:47] 25.65% [17:16:48] 26.67% [17:16:49] 27.70% [17:16:50] 28.72% [17:16:51] 29.75% [17:16:52] 30.77% [17:16:53] 31.80% [17:16:54] 32.82% [17:16:55] 33.85% [17:16:56] 34.87% [17:16:57] 35.90% [17:16:58] 36.92% [17:16:59] 37.95% [17:17:0] 38.97% [17:17:1] 40.00% [17:17:2] 41.02% [17:17:3] 42.04% [17:17:4] 43.07% [17:17:5] 44.09% [17:17:6] 45.12% [17:17:7] 46.14% [17:17:8] 47.17% [17:17:9] 48.19% [17:17:10] 49.22% [17:17:11] 50.24% [17:17:12] 51.27% [17:17:13] 52.29% [17:17:14] 53.32% [17:17:15] 54.34% [17:17:16] 55.37% [17:17:17] 56.39% [17:17:18] 57.41% [17:17:19] 58.44% [17:17:20] 59.46% [17:17:21] 60.49% [17:17:22] 61.51% [17:17:23] 62.54% [17:17:24] 63.56% [17:17:25] 64.59% [17:17:26] 65.61% [17:17:27] 66.64% [17:17:28] 67.66% [17:17:29] 68.69% [17:17:30] 69.71% [17:17:31] 70.74% [17:17:32] 71.76% [17:17:33] 72.79% [17:17:34] 73.81% [17:17:35] 74.83% [17:17:36] 75.86% [17:17:37] 76.88% [17:17:38] 77.91% [17:17:39] 78.93% [17:17:40] 79.96% [17:17:41] 80.98% [17:17:42] 82.01% [17:17:43] 83.03% [17:17:44] 84.06% [17:17:45] 85.08% [17:17:46] 86.11% [17:17:47] 87.13% [17:17:48] 88.16% [17:17:49] 89.18% [17:17:50] 90.21% [17:17:51] 91.23% [17:17:52] 92.25% [17:17:53] 93.28% [17:17:54] 94.30% [17:17:55] 95.33% [17:17:56] 96.35% [17:17:57] 97.36% [17:17:58] 98.39% [17:17:59] 99.41% [17:18:0] Done Finished in : 1.63 min

Absolute blind guess on my side (as I haven’t used this myself at all) … maybe it’s just a result of a defined buffersize somewhere in the implementation and the actual framerate the app is running.

Not sure if it’s a good enough test, but you could try to set the fps in your config.lua to 30 and 60 and see if it makes any difference.

I don’t want to seem like a jerk here, but I can’t test this.  I get an error:

Aug 12 12:58:47.240 2018-08-12 12:58:47.239 Corona Simulator[17569:4139714] ERROR: network: network request failed: http://yourserver/path_to_your_test_file.zip [-1003: A server with the specified hostname could not be found.]

I can’t possibly reproduce your experience if I’m having to use my own servers, or guess at what content you’re trying to download. I can’t take up an engineer’s time to investigate this for the same reason. Their experience will be different than your’s because the project isn’t complete and we would have to guess at what you’re doing…

Please share a sample project, complete with the config.lua and build.settings you are using. If there is an option to download from a remote server, please use your server and the file you’re testing against. If you’re using a local http server on localhost, please include the file you’re trying to download along with the URL to the local host file. It would be very useful to provide a couple of UI buttons that start the various downloads.

Please provide a complete project that I can have an engineer unzip, run and see the issue without asking us to do any edits where possible.

Rob

I’ve updated the project.  You won’t have to change any URLs.  There are 3 file locations to choose from: Coronalabs server, Microsoft and NVIDIA.  The first 30MB docs file is sourced from Coronalabs and finishes in about a minute.

I also ran a test on my Windows 10 laptop and a Windows 7 VM.  In both cases the downloads were just as slow.  So that’s 4 machines in total now that exhibit this behavior.

https://drive.google.com/open?id=1I_TotW7DNjGWvh7kpC5cg6kX-tZUL9Ho

Thanks for the suggestion.  Unfortunately it didn’t work.