[ 
https://issues.apache.org/jira/browse/COUCHDB-2724?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14637170#comment-14637170
 ] 

Adam Kocoloski commented on COUCHDB-2724:
-----------------------------------------

I did the byte-wise comparison with and without the patch (and the buffer size 
set to 0); the difference right now is that the trailing bits of the response 
get merged into the last row, e.g.

{code}
8a
{"id":"0ef72c5c4ebb9fa341cae628e6003b37","key":"0ef72c5c4ebb9fa341cae628e6003b37","value":{"rev":"1-967a00dff5e02add41819138abb3284d"}}
8e
,
{"id":"0ef72c5c4ebb9fa341cae628e60045be","key":"0ef72c5c4ebb9fa341cae628e60045be","value":{"rev":"1-967a00dff5e02add41819138abb3284d"}}
]}
1


0
{code}

instead of

{code}
8a
{"id":"0ef72c5c4ebb9fa341cae628e6003b37","key":"0ef72c5c4ebb9fa341cae628e6003b37","value":{"rev":"1-967a00dff5e02add41819138abb3284d"}}
8a
,
{"id":"0ef72c5c4ebb9fa341cae628e60045be","key":"0ef72c5c4ebb9fa341cae628e60045be","value":{"rev":"1-967a00dff5e02add41819138abb3284d"}}
4

]}
1


0
{code}

Easy enough to address, although I'd probably special-case it for the 
threshold=0 case rather than always sending the extra chunk.

> Batch rows in streaming responses to improve throughput
> -------------------------------------------------------
>
>                 Key: COUCHDB-2724
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-2724
>             Project: CouchDB
>          Issue Type: Improvement
>      Security Level: public(Regular issues) 
>          Components: Database Core, HTTP Interface
>            Reporter: Adam Kocoloski
>            Assignee: Adam Kocoloski
>
> [~tonysun83] showed me some profiling of the {{_changes}} feed which 
> indicated that the coordinator process was spending about 1/3 of its time 
> executing inside {{send_delayed_chunk}}. We can reduce the number of 
> invocations of this function by buffering individual rows until we reach a 
> (configurable) threshold for sending the data out the wire.
> We'll of course want to be careful about continuous feeds; if we're in the 
> "slow drip" portion of the feed we'll obviously want to emit right away 
> instead of adding latency unnecessarily.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to