Use both ends of the pipe in parallel#5
Open
JesHansen wants to merge 1 commit into
Open
Conversation
By splitting the pipe into the writing end and reading end it seems to be able to slightly boost performance. On my system it benchmarks as roughly ~10% faster to have the file being parsed while it is loading in. ``` ini BenchmarkDotNet=v0.13.0, OS=Windows 10.0.19042.985 (20H2/October2020Update) AMD Ryzen 7 5800X, 1 CPU, 16 logical and 8 physical cores .NET SDK=5.0.203 [Host] : .NET 5.0.6 (5.0.621.22011), X64 RyuJIT DefaultJob : .NET 5.0.6 (5.0.621.22011), X64 RyuJIT ``` | Method | Mean | Error | StdDev | Rank | Gen 0 | Gen 1 | Gen 2 | Allocated | |------------ |----------:|---------:|---------:|-----:|----------:|----------:|----------:|----------:| | FullPipe | 51.77 ms | 0.363 ms | 0.303 ms | 1 | 1000.0000 | 500.0000 | - | 17 MB | | PipeLines | 56.97 ms | 0.400 ms | 0.355 ms | 2 | 1000.0000 | 444.4444 | - | 17 MB | | CsvHelper | 136.83 ms | 1.827 ms | 1.709 ms | 3 | 5250.0000 | 2250.0000 | 1500.0000 | 77 MB | | AsyncStream | 153.04 ms | 2.995 ms | 4.483 ms | 4 | 4250.0000 | 2500.0000 | 750.0000 | 64 MB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By splitting the pipe into the writing end and reading end it
seems to be able to slightly boost performance. On my system
it benchmarks as roughly ~10% faster to have the file being
parsed while it is loading in.