That means every parallel worker gets 1 item to process at a time, and reports the result as soon as possible. If, for example, an operation is long-running per item, and you need the first results as soon as possible, set it to 1. It allows for making a throughput/latency trade-off. The batch size option configures the number of items sent to a given parallel worker at once. For CPU-bound work, however, it makes no sense to pick a number higher than the CPU core count. Note that in some cases, choosing a degree higher than the available CPU cores can make sense, for example I/O bound work or latency-heavy tasks like web crawling. to use at most 4 cores), pass :4degree to the hyper or race method. The degree option (short for "degree of parallelism") configures how many parallel workers should be started. See race for situations where items are processed in parallel and the output order does not matter. Use hyper in situations where it is OK to do the processing of items in parallel, and the output order should be kept relative to the input order. Mapping from strings to itemized values Table of Contents 1
0 Comments
Leave a Reply. |