-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f74924
commit e17aeb8
Showing
1 changed file
with
113 additions
and
95 deletions.
There are no files selected for viewing
This file contains 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
e17aeb8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CSV Performance Improvements?
A few months ago I hade a big 5gb CSV so I went ahead and made some changes in the way the CSV parser works, instead of using
Regex
andstring
was using a custom parser based onSpan<T>
.All my intuitions made me think this code should be faster. So I proudly commited and pushed sure of the new insine performance.
Now, a few months later I wanted to brag about the performance improvements so I took the time to measure the performance of the old and new version
Oh shit... the new code is 3x times slower. How it is possible? I was reducing allocations and all...
No idea, if someone wants to take a a deeper look go for it.... for me I'm going to revert to the old code, with the only exception of malking
AssumeSingleLine = true
the default.The moral of the story: Measure your code! Every time I open the heavy profiler I find something new