On Fri, Nov 1, 2019 at 3:22 AM amg <[email protected]> wrote:

> Hi Kenton,
>
> thank you very much for your detailed reply!
>
> As the overall processing speed will be crucial (in my aforementioned
> naive single-threaded approach the tcp recv buffer turned out to be a
> bottleneck), I'd like to borrow you expertise once more.
>
> In your opinion, which of the two options you indicated
> (expectedSizeInWordsFromPrefix vs. AsyncIoStream) will be the more
> promising when it comes to processing speed?
>

I am not sure, but using expectedSizeInWordsFromPrefix() will give you much
more control which will allow you to optimize for your use case.


> Given the first option: How many bytes do I have to read before
> expectedSizeInWordsFromPrefix() can determine the definitive amount of
> bytes of the current message? Based on previous discussions on this board,
> I'd say at least 8 bytes (4 bytes = count of segments + N x 4 bytes = sizes
> of the segments)... is that correct?
>

That is correct. Once the full segment table is available,
then expectedSizeInWordsFromPrefix() will return the final size of the
message.

You can look at the code for expectedSizeInWordsFromPrefix() to see how it
works -- it's not that long. :)

-Kenton

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/CAJouXQmCz2ah1gY73kzOd6m6P%3DRD39eFxvVm__0ktgVNwuXjDA%40mail.gmail.com.

Reply via email to