Skip to content

Added benchmark for FlatFiles#26

Merged
joelverhagen merged 4 commits into
joelverhagen:mainfrom
JoshClose:flatfiles
Jan 29, 2021
Merged

Added benchmark for FlatFiles#26
joelverhagen merged 4 commits into
joelverhagen:mainfrom
JoshClose:flatfiles

Conversation

@JoshClose

Copy link
Copy Markdown
Contributor

No description provided.

@JoshClose JoshClose mentioned this pull request Jan 28, 2021
{
var values = csvReader.GetValues();
var record = activate();
record.Read(i => values[i]?.ToString() ?? string.Empty);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the first ? necessary? When would values[i] return null? Ideally we have minimal null coalescence since that is extra operations and will yield worse performance.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is null instead of an empty string when the field is empty. Maybe there's a setting to change that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see anything in options. If you have a faster way of checking for a null and returning a string if it is, let me know. I have never performance tested that scenario.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, makes sense!

@joelverhagen joelverhagen merged commit 10fbbbd into joelverhagen:main Jan 29, 2021
@JoshClose JoshClose deleted the flatfiles branch January 29, 2021 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants