Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upSpan and pipelinify all the things #1
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
indy-singh
Jun 8, 2018
Owner
Hi @davidfowl
Love it! I honestly didn't expect the article to generate so much discussion. A lot of people have been asking about a Span<T> version and now I can just point them to V13 - thanks for contributing!
Cheers,
Indy
|
Hi @davidfowl Love it! I honestly didn't expect the article to generate so much discussion. A lot of people have been asking about a Cheers, |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
kierenj
Jun 8, 2018
You wouldn't fancy putting together a similar blog write-up of this, @davidfowl ? I mean, the code is great, but another decent blog post on these topics would make the world a better place?
kierenj
commented
Jun 8, 2018
|
You wouldn't fancy putting together a similar blog write-up of this, @davidfowl ? I mean, the code is great, but another decent blog post on these topics would make the world a better place? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
davidfowl
commented
Jun 8, 2018
•
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
davidfowl
commented
Jun 8, 2018
•
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
davidfowl
commented
Jun 9, 2018
•
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
davidfowl
Jun 9, 2018
4K buffer. I think to go into the single digit realm I'll need a custom pipe implementation that just uses a single 4K buffer for the entire read.
#13 ViaPipeReader
Took: 6,406 ms
Allocated: 56 kb
Peak Working Set: 15,264 kb
Gen 0 collections: 0
Gen 1 collections: 0
Gen 2 collections: 0
davidfowl
commented
Jun 9, 2018
|
4K buffer. I think to go into the single digit realm I'll need a custom pipe implementation that just uses a single 4K buffer for the entire read.
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
davidfowl
Jun 9, 2018
Ok now we're cooking:
#13 ViaPipeReader
Took: 5,844 ms
Allocated: 16 kb
Peak Working Set: 13,120 kb
Gen 0 collections: 0
Gen 1 collections: 0
Gen 2 collections: 0
davidfowl
commented
Jun 9, 2018
|
Ok now we're cooking: #13 ViaPipeReader
Took: 5,844 ms
Allocated: 16 kb
Peak Working Set: 13,120 kb
Gen 0 collections: 0
Gen 1 collections: 0
Gen 2 collections: 0 |



davidfowl commentedJun 8, 2018
•
edited
Edited 1 time
-
davidfowl
edited Jun 9, 2018 (most recent)
-
davidfowl
created Jun 8, 2018
This blog post basically nerd sniped me. So here's a version of the line parser and file reader that tries to be extremely optimal (there's some other things that can be done but I have to sleep). It's using System.IO.Pipelines to do the file reading and Span to do the line parsing. I copied BufferReader over from the ASP.NET Core common repository (Kestrel uses this internally for HTTP Parsing).
On my machine these are the results:
Latest Results:
Ok now we're cooking: