Skip to content
This repository has been archived by the owner on Mar 9, 2020. It is now read-only.

Speed up ExcelStyleCollection #630

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Speed up ExcelStyleCollection #630

wants to merge 1 commit into from

Conversation

Kizaemon
Copy link

@Kizaemon Kizaemon commented Mar 8, 2020

Removed redundant dictionary lookups and redundant key casing.
My benchmarks show measurable speed increase.

The underlying dictionary is already OrdinalIgnoreCase, so no need to apply key.ToLower(CultureInfo.InvariantCulture)
The calls should be to the more efficient TryGetValue, instead of two separate calls to ContainsKey and GetValue.

Removed redundant dictionary lookups and redundant key casing.
My benchmarks show measurable speed increase.

The underlying dictionary is already OrdinalIgnoreCase, so no need to apply key.ToLower(CultureInfo.InvariantCulture)
The calls should be to the more efficient TryGetValue, instead of two separate calls to ContainsKey and GetValue.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant