@@ -72,6 +72,7 @@ private static byte[] GenerateUnicodeTestData (int lineCount)
7272 }
7373
7474 [ Benchmark ( Baseline = true ) ]
75+ [ BenchmarkCategory ( "Legacy" , "Small" , "ReadAll" ) ]
7576 public void Legacy_ReadAll_Small ( )
7677 {
7778 using var stream = new MemoryStream ( _smallTestData ) ;
@@ -80,6 +81,7 @@ public void Legacy_ReadAll_Small ()
8081 }
8182
8283 [ Benchmark ]
84+ [ BenchmarkCategory ( "System" , "Small" , "ReadAll" ) ]
8385 public void System_ReadAll_Small ( )
8486 {
8587 using var stream = new MemoryStream ( _smallTestData ) ;
@@ -88,14 +90,7 @@ public void System_ReadAll_Small ()
8890 }
8991
9092 [ Benchmark ]
91- public void Pipeline_ReadAll_Small ( )
92- {
93- using var stream = new MemoryStream ( _smallTestData ) ;
94- using var reader = new PositionAwareStreamReaderPipeline ( stream , new EncodingOptions ( ) , 10000 ) ;
95- ReadAllLines ( reader ) ;
96- }
97-
98- [ Benchmark ]
93+ [ BenchmarkCategory ( "Legacy" , "Medium" , "ReadAll" ) ]
9994 public void Legacy_ReadAll_Medium ( )
10095 {
10196 using var stream = new MemoryStream ( _mediumTestData ) ;
@@ -104,6 +99,7 @@ public void Legacy_ReadAll_Medium ()
10499 }
105100
106101 [ Benchmark ]
102+ [ BenchmarkCategory ( "System" , "Medium" , "ReadAll" ) ]
107103 public void System_ReadAll_Medium ( )
108104 {
109105 using var stream = new MemoryStream ( _mediumTestData ) ;
@@ -112,14 +108,7 @@ public void System_ReadAll_Medium ()
112108 }
113109
114110 [ Benchmark ]
115- public void Pipeline_ReadAll_Medium ( )
116- {
117- using var stream = new MemoryStream ( _mediumTestData ) ;
118- using var reader = new PositionAwareStreamReaderPipeline ( stream , new EncodingOptions ( ) , 10000 ) ;
119- ReadAllLines ( reader ) ;
120- }
121-
122- [ Benchmark ]
111+ [ BenchmarkCategory ( "Legacy" , "Large" , "ReadAll" ) ]
123112 public void Legacy_ReadAll_Large ( )
124113 {
125114 using var stream = new MemoryStream ( _largeTestData ) ;
@@ -128,6 +117,7 @@ public void Legacy_ReadAll_Large ()
128117 }
129118
130119 [ Benchmark ]
120+ [ BenchmarkCategory ( "System" , "Large" , "ReadAll" ) ]
131121 public void System_ReadAll_Large ( )
132122 {
133123 using var stream = new MemoryStream ( _largeTestData ) ;
@@ -136,37 +126,20 @@ public void System_ReadAll_Large ()
136126 }
137127
138128 [ Benchmark ]
139- public void Pipeline_ReadAll_Large ( )
140- {
141- using var stream = new MemoryStream ( _largeTestData ) ;
142- using var reader = new PositionAwareStreamReaderPipeline ( stream , new EncodingOptions ( ) , 10000 ) ;
143- ReadAllLines ( reader ) ;
144- }
145-
146- [ Benchmark ]
147- public void Pipeline_ReadAll_Unicode ( )
129+ [ BenchmarkCategory ( "System" , "Unicode" , "ReadAll" ) ]
130+ public void System_ReadAll_Unicode ( )
148131 {
149132 using var stream = new MemoryStream ( _unicodeTestData ) ;
150- using var reader = new PositionAwareStreamReaderPipeline ( stream , new EncodingOptions { Encoding = Encoding . UTF8 } , 10000 ) ;
133+ using var reader = new PositionAwareStreamReaderSystem ( stream , new EncodingOptions ( ) , 10000 ) ;
151134 ReadAllLines ( reader ) ;
152135 }
153136
154137 [ Benchmark ]
155- public void Pipeline_Seek_And_Read ( )
138+ [ BenchmarkCategory ( "Legacy" , "Unicode" , "ReadAll" ) ]
139+ public void Legacy_ReadAll_Unicode ( )
156140 {
157- using var stream = new MemoryStream ( _mediumTestData ) ;
158- using var reader = new PositionAwareStreamReaderPipeline ( stream , new EncodingOptions ( ) , 10000 ) ;
159-
160- // Read first 100 lines
161- for ( int i = 0 ; i < 100 ; i ++ )
162- {
163- _ = reader . ReadLine ( ) ;
164- }
165-
166- // Seek back to beginning
167- reader . Position = 0 ;
168-
169- // Read all lines
141+ using var stream = new MemoryStream ( _unicodeTestData ) ;
142+ using var reader = new PositionAwareStreamReaderLegacy ( stream , new EncodingOptions ( ) , 10000 ) ;
170143 ReadAllLines ( reader ) ;
171144 }
172145
0 commit comments