Skip to content

Faster enum -> string resolution #2418

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

Merged
merged 1 commit into from
Nov 29, 2016
Merged

Faster enum -> string resolution #2418

merged 1 commit into from
Nov 29, 2016

Conversation

russcam
Copy link
Contributor

@russcam russcam commented Nov 28, 2016

  • Specific enum GetStringValue extension methods for known enums
  • Caching of generic method of resolving string values for enums based on enum type.
  • Renamed KnownEnums.Resolve to GetStringValue and made an extension method. Allows enum specific overloads to be introduced where necessary
  • Added GetStringValue extension method for HttpMethod - this is a hot path, called on every request.
  • Fixed casing issue in HttpConnection for setting ContentLength

Closes #2400

Specific enum GetStringValue extension methods for known enums
Caching of generic method of resolving string values for enums based on enum type.
Renamed KnownEnums.Resolve to GetStringValue and made an extension method.
Added GetStringValue extension method for HttpMethod - this is a hot path, called on every request.
Fixed casing issue in HttpConnection for setting ContentLength

Closes #2400
Copy link
Member

@Mpdreamz Mpdreamz left a comment

Choose a reason for hiding this comment

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

LGTM 👍 should have done this from the start

@Mpdreamz Mpdreamz merged commit c687177 into 5.x Nov 29, 2016
@Mpdreamz Mpdreamz deleted the fix/5.x-enum-resolution branch November 29, 2016 08:52
Mpdreamz pushed a commit that referenced this pull request Nov 29, 2016
Specific enum GetStringValue extension methods for known enums
Caching of generic method of resolving string values for enums based on enum type.
Renamed KnownEnums.Resolve to GetStringValue and made an extension method.
Added GetStringValue extension method for HttpMethod - this is a hot path, called on every request.
Fixed casing issue in HttpConnection for setting ContentLength

Closes #2400
Conflicts:
	src/Elasticsearch.Net/Domain/Enums.Generated.cs
Mpdreamz pushed a commit that referenced this pull request Nov 29, 2016
Specific enum GetStringValue extension methods for known enums
Caching of generic method of resolving string values for enums based on enum type.
Renamed KnownEnums.Resolve to GetStringValue and made an extension method.
Added GetStringValue extension method for HttpMethod - this is a hot path, called on every request.
Fixed casing issue in HttpConnection for setting ContentLength

Closes #2400
Conflicts:
	src/CodeGeneration/ApiGenerator/Views/Enums.Generated.cshtml
	src/Elasticsearch.Net/Domain/Enums.Generated.cs
	src/Elasticsearch.Net/Extensions/Extensions.cs
	src/Nest/Mapping/AttributeBased/ElasticsearchCorePropertyAttributeBase.cs
	src/Nest/Mapping/Types/Core/Number/NumberAttribute.cs
@Mpdreamz
Copy link
Member

ported to master and 2.x

@russcam russcam added v2.5.0 and removed v5.0.0 labels Dec 1, 2016
awelburn pushed a commit to Artesian/elasticsearch-net that referenced this pull request Nov 6, 2017
Specific enum GetStringValue extension methods for known enums
Caching of generic method of resolving string values for enums based on enum type.
Renamed KnownEnums.Resolve to GetStringValue and made an extension method.
Added GetStringValue extension method for HttpMethod - this is a hot path, called on every request.
Fixed casing issue in HttpConnection for setting ContentLength

Closes elastic#2400
Conflicts:
	src/Elasticsearch.Net/Domain/Enums.Generated.cs
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