thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hassan Chen <senhaoc...@gmail.com>
Subject Re: Why TFramedTransport so much slow when transport big data?
Date Wed, 17 Apr 2013 08:50:33 GMT
But when I use TSimpleServer and TBufferedTransport, it very fast.

It only use 0m1.645s when transfer 829K data.

Can you tell me why Non-blocking way is so much slower than blocking way?


On Wed, Apr 17, 2013 at 4:33 PM, Hassan Chen <senhaochen@gmail.com> wrote:

> Have any way to improve it ?  Google tell me nothing.
>
>
> On Wed, Apr 17, 2013 at 4:30 PM, Matthew Chambers <mchambers@wetafx.co.nz>wrote:
>
>>
>> Yes, because PHP is an interpreted language.
>>
>>
>> On 17/04/13 20:27, Hassan Chen wrote:
>>
>>> o(╯□╰)o, about 17999 books. This only a test. In practical applications,
>>> I
>>> also transfer the array data like this but not books.
>>> Buy I found when transfer large amounts of data one-time, php is very
>>> slow.
>>>   Can you tell me why?
>>>
>>>
>>> On Wed, Apr 17, 2013 at 4:20 PM, Matthew Chambers <
>>> mchambers@wetafx.co.nz>wrote:
>>>
>>>  How much roughly would 829k worth of books cost?  Are you preparing for
>>>> people to order the entire amazon library through your interface?
>>>>
>>>>
>>>> On 17/04/13 20:06, Hassan Chen wrote:
>>>>
>>>>  Hi,
>>>>> Now I'm using TNonblockingServer.  But I found php is so slow than cpp.
>>>>>
>>>>> The testing result:
>>>>>
>>>>> server  client  data size  time
>>>>>    cpp      php    829K        2m23.110s
>>>>>    cpp      php    446K        0m33.337s
>>>>>    cpp      php    199K        0m4.305s
>>>>>    cpp      cpp     829K       0m0.564s
>>>>>
>>>>> The service and data struct is:
>>>>> struct Book {
>>>>>       1: i32 book_id,
>>>>>      2: string book_name,
>>>>>      3: string book_author,
>>>>>      4: double book_price,
>>>>>      5: string book_publisher,
>>>>>      6: i32    age,
>>>>> }
>>>>>
>>>>> service BookOrder {
>>>>>       list<Book> order(1: string book);
>>>>> }
>>>>>
>>>>>
>>>>> Now I have some question:
>>>>> 1. Why php is so much slower than cpp
>>>>> 2. As the amount of data increases, the php's performance drastically
>>>>> reduced
>>>>>
>>>>> can anyone tell me?
>>>>>
>>>>> Thanks.
>>>>> --
>>>>> Hassan Chen
>>>>>
>>>>>
>>>>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message