ParallelMergeOptions.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // ==++==
  2. //
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. //
  5. // ==--==
  6. // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  7. //
  8. // ParallelMergeOptions.cs
  9. //
  10. // <OWNER>igoro</OWNER>
  11. //
  12. // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  13. namespace System.Linq
  14. {
  15. /// <summary>
  16. /// Specifies the preferred type of output merge to use in a query. This is a hint only, and may not be
  17. /// respected by the system when parallelizing all queries.
  18. /// </summary>
  19. /// <remarks>
  20. /// <para>
  21. /// Use <b>NotBuffered</b> for queries that will be consumed and output as streams, this has the lowest latency
  22. /// between beginning query execution and elements being yielded. For some queries, such as those involving a
  23. /// sort (OrderBy, OrderByDescending), buffering is essential and a hint of NotBuffered or AutoBuffered will
  24. /// be ignored.
  25. /// </para>
  26. /// <para>
  27. /// Use <b>AutoBuffered</b> for most cases; this is the default. It strikes a balance between latency and
  28. /// overall performance.
  29. /// </para>
  30. /// <para>
  31. /// Use <b>FullyBuffered</b> for queries when the entire output can be processed before the information is
  32. /// needed. This option offers the best performance when all of the output can be accumulated before yielding
  33. /// any information, though it is not suitable for stream processing or showing partial results mid-query.
  34. /// </para>
  35. /// </remarks>
  36. public enum ParallelMergeOptions
  37. {
  38. /// <summary>
  39. /// Use the default merge type, which is AutoBuffered.
  40. /// </summary>
  41. Default = 0,
  42. /// <summary>
  43. /// Use a merge without output buffers. As soon as result elements have been computed,
  44. /// make that element available to the consumer of the query.
  45. /// </summary>
  46. NotBuffered = 1,
  47. /// <summary>
  48. /// Use a merge with output buffers of a size chosen by the system. Results
  49. /// will accumulate into an output buffer before they are available to the consumer of
  50. /// the query.
  51. /// </summary>
  52. AutoBuffered = 2,
  53. /// <summary>
  54. /// Use a merge with full output buffers. The system will accumulate all of the
  55. /// results before making any of them available to the consumer of the query.
  56. /// </summary>
  57. FullyBuffered = 3
  58. }
  59. }