Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added benchmark for FlatFiles #26

Merged
merged 4 commits into from
Jan 29, 2021
Merged

Added benchmark for FlatFiles #26

merged 4 commits into from
Jan 29, 2021

Conversation

JoshClose
Copy link
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
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
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
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
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