Hi.
I found a performance problems with HTTPClient and HTTPText.
The library is great. I tried to read a text file from a HTTP server.
But the performance has characteristic abnormality.
So I check the performace problems.
Please see the result.
The tests
Text files on a HTTP server
I created some text files on a HTTP server.
The size are 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096 bytes.
e.g.) http://mbed.org/media/uploads/shintamainjp/textfile_32bytes.txt
A test program
- Read a text file from HTTP server.
- Buffer size of HTTPText : 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096
- File size on HTTP server : 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096
e.g.) http://mbed.org/users/shintamainjp/programs/PerformanceProblemsWithHTTPText/latest
The results
(Buffer size of a HTTPText : 8)
+---------+--------+----+
|File size|Time[ms]|Code|
+---------+--------+----+
| 8| 31525| 200|
| 16| 30976| 200|
| 32| 30974| 200|
| 64| 30976| 200|
| 128| 30978| 200|
| 256| 30974| 200|
| 512| 30971| 200|
| 1024| 30974| 200|
| 2048| 30975| 200|
| 4096| 30976| 200|
+---------+--------+----+
(Buffer size of a HTTPText : 16)
+---------+--------+----+
|File size|Time[ms]|Code|
+---------+--------+----+
| 8| 831| 200|
| 16| 30977| 200|
| 32| 30970| 200|
| 64| 30977| 200|
| 128| 30975| 200|
| 256| 30978| 200|
| 512| 30972| 200|
| 1024| 30976| 200|
| 2048| 30976| 200|
| 4096| 30976| 200|
+---------+--------+----+
(Buffer size of a HTTPText : 32)
+---------+--------+----+
|File size|Time[ms]|Code|
+---------+--------+----+
| 8| 831| 200|
| 16| 971| 200|
| 32| 30975| 200|
| 64| 30976| 200|
| 128| 30980| 200|
| 256| 30972| 200|
| 512| 30976| 200|
| 1024| 30985| 200|
| 2048| 30966| 200|
| 4096| 30974| 200|
+---------+--------+----+
(Buffer size of a HTTPText : 64)
+---------+--------+----+
|File size|Time[ms]|Code|
+---------+--------+----+
| 8| 830| 200|
| 16| 975| 200|
| 32| 975| 200|
| 64| 30971| 200|
| 128| 30980| 200|
| 256| 30972| 200|
| 512| 30980| 200|
| 1024| 30970| 200|
| 2048| 30976| 200|
| 4096| 30975| 200|
+---------+--------+----+
(Buffer size of a HTTPText : 128)
+---------+--------+----+
|File size|Time[ms]|Code|
+---------+--------+----+
| 8| 828| 200|
| 16| 975| 200|
| 32| 974| 200|
| 64| 976| 200|
| 128| 30974| 200|
| 256| 30976| 200|
| 512| 30976| 200|
| 1024| 30975| 200|
| 2048| 30976| 200|
| 4096| 30974| 200|
+---------+--------+----+
(Buffer size of a HTTPText : 256)
+---------+--------+----+
|File size|Time[ms]|Code|
+---------+--------+----+
| 8| 829| 200|
| 16| 974| 200|
| 32| 973| 200|
| 64| 974| 200|
| 128| 974| 200|
| 256| 30975| 200|
| 512| 30977| 200|
| 1024| 30975| 200|
| 2048| 30977| 200|
| 4096| 30977| 200|
+---------+--------+----+
(Buffer size of a HTTPText : 512)
+---------+--------+----+
|File size|Time[ms]|Code|
+---------+--------+----+
| 8| 827| 200|
| 16| 975| 200|
| 32| 973| 200|
| 64| 973| 200|
| 128| 978| 200|
| 256| 969| 200|
| 512| 30975| 200|
| 1024| 30977| 200|
| 2048| 30975| 200|
| 4096| 30975| 200|
+---------+--------+----+
(Buffer size of a HTTPText : 1024)
+---------+--------+----+
|File size|Time[ms]|Code|
+---------+--------+----+
| 8| 829| 200|
| 16| 973| 200|
| 32| 973| 200|
| 64| 975| 200|
| 128| 974| 200|
| 256| 974| 200|
| 512| 975| 200|
| 1024| 30974| 200|
| 2048| 30976| 200|
| 4096| 30976| 200|
+---------+--------+----+
(Buffer size of a HTTPText : 2048)
+---------+--------+----+
|File size|Time[ms]|Code|
+---------+--------+----+
| 8| 830| 200|
| 16| 974| 200|
| 32| 977| 200|
| 64| 976| 200|
| 128| 971| 200|
| 256| 976| 200|
| 512| 1106| 200|
| 1024| 848| 200|
| 2048| 31364| 200|
| 4096| 30851| 200|
+---------+--------+----+
(Buffer size of a HTTPText : 4096)
+---------+--------+----+
|File size|Time[ms]|Code|
+---------+--------+----+
| 8| 564| 200|
| 16| 968| 200|
| 32| 973| 200|
| 64| 974| 200|
| 128| 975| 200|
| 256| 975| 200|
| 512| 971| 200|
| 1024| 976| 200|
| 2048| 1244| 200|
| 4096| 31251| 200|
+---------+--------+----+
Why it's spent over 30 seconds?
I think the library has a performance problems in that implementations.
I can't see the sources. so I don't know why it's spent so much time.
But I wanna be fix it. I can't wait over 30 seconds for getting a data from HTTP server.
The network function is big feauture in mbed I think.
Please check the implementations.
Resources
* The test program : PerformanceProblemsWithHTTPText
Hi.
I found a performance problems with HTTPClient and HTTPText.
The library is great. I tried to read a text file from a HTTP server.
But the performance has characteristic abnormality.
So I check the performace problems.
Please see the result.
The tests
Text files on a HTTP server
I created some text files on a HTTP server.
The size are 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096 bytes.
e.g.) http://mbed.org/media/uploads/shintamainjp/textfile_32bytes.txt
A test program
e.g.) http://mbed.org/users/shintamainjp/programs/PerformanceProblemsWithHTTPText/latest
The results
Why it's spent over 30 seconds?
I think the library has a performance problems in that implementations.
I can't see the sources. so I don't know why it's spent so much time.
But I wanna be fix it. I can't wait over 30 seconds for getting a data from HTTP server.
The network function is big feauture in mbed I think.
Please check the implementations.
Resources
* The test program : PerformanceProblemsWithHTTPText