Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-1497

Make multi-methods that depend on Parallel.ForEach obsolete

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.0
    • Fix Version/s: 2.5.0
    • Component/s: library
    • Labels:
      None

      Description

      The multi-methods which depend upon Parallel.ForEach require specific tuning depending upon the hardware they are run on to get decent performance, are easy to use incorrectly, and Parallel.ForEach are better suited for compute-bound operations instead of IO-bound operations. 

      We suggest that users use the async multi/bulk methods instead:

      public void async GetKeys(List<string> keys)
      {
          var tasks = new List<Task<IOperationResult>>();
          foreach(var key in keys)
          {
              tasks.Add(bucket.GetAsync(key));
          }
          var results = await Task.WhenAll(tasks);
       
          // do something with the results
      }

       

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              jmorris Jeff Morris
              Reporter:
              jmorris Jeff Morris
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes

                  PagerDuty

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.