Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Although it should not be necessary in most situations, you can influence the IO size used by GCD with the <code>dispatch_io_set_high_water(3)</code> and <code>dispatch_io_set_low_water(3)</code> APIs. </p> <p>GCD will not read or write chunks larger than a channel's high water mark. Read/write handlers will also never be called with a data object that is smaller than the low water mark.</p> <p>E.g. by setting the low water mark of <code>input_</code> in your example to 1MB you can ensure that your current read callback does not pass data objects smaller than 1MB to <code>dispatch_io_write(3)</code>.</p> <p>If this control doesn't suffice in your situation, you could also combine multiple data objects received from successive invocations of your read handler via <code>dispatch_data_create_concat(3)</code> until they reach a size big enough to pass to <code>dispatch_io_write(3)</code>.</p> <p>Hopefully this should not be necessary however, setting the source side's low water mark to a multiple of the preferred source chunk size big enough to reach the preferred destination chunk size and setting the destination channel's high water mark to the preferred destination chunk size (or a multiple thereof) should give you the same performance as your current NSStream-based solution.</p> <p>You can check out the specifics of the GCD IO buffer policy in the <a href="http://libdispatch.macosforge.org/trac/browser/branches/Lion/src/io.c#L1928" rel="noreferrer">implementation</a>.</p> <p>In any case, please make sure to file a <a href="http://bugreport.apple.com" rel="noreferrer">bug</a> with the specifics of any case where you see performance issues with the default GCD IO buffering.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload