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

Use OrdinalIgnoreCase instead of InvariantCultureIgnoreCase #1021

Closed
smedilol opened this issue Jul 2, 2018 · 1 comment
Closed

Use OrdinalIgnoreCase instead of InvariantCultureIgnoreCase #1021

smedilol opened this issue Jul 2, 2018 · 1 comment
Assignees
Labels
Enhancement Performance User Visible Visible by the end user. Useful to priorize issue
Milestone

Comments

@smedilol
Copy link
Contributor

smedilol commented Jul 2, 2018

When comparing String, OrdinalIgnoreCase is supposed to be faster than InvariantCultureIgnoreCase.

As the Cobol source code is not Culture dependant, we can switch to OrdinalIgnoreCase in SymbolTable and compare performance.

@smedilol smedilol added Enhancement User Visible Visible by the end user. Useful to priorize issue Performance labels Jul 2, 2018
@smedilol smedilol added this to the V1.2.1 milestone Jul 2, 2018
@cobarzanc
Copy link
Contributor

cobarzanc commented Jul 3, 2018

Indeed, the OrdinalIgnoreCase StringComparer is much faster than InvariantCultureIgnoreCase. A performance comparison is available here (https://blogs.msdn.microsoft.com/noahc/2007/06/29/string-equals-performance-comparison/). Using OrdinalIgnoreCase brings arround 5x improvement in speed when compared to InvariantCultureIgnoreCase (in .Net 3.5).

Microsoft take on best practices for string manipulation - https://docs.microsoft.com/en-us/dotnet/standard/base-types/best-practices-strings

cobarzanc added a commit that referenced this issue Jul 3, 2018
OrdinalIgnoreCase for StringComparison
smedilol added a commit that referenced this issue Jul 4, 2018
Issue #1021 Changed culture from InvariantCultureIgnoreCase to
@smedilol smedilol closed this as completed Jul 9, 2018
@smedilol smedilol mentioned this issue Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Performance User Visible Visible by the end user. Useful to priorize issue
Projects
None yet
Development

No branches or pull requests

2 participants