Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Faster IFeatureCollection.Get<TFeature>#2012

Closed
benaadams wants to merge 1 commit intoaspnet:devfrom
benaadams:generic-featurecollection
Closed

Faster IFeatureCollection.Get<TFeature>#2012
benaadams wants to merge 1 commit intoaspnet:devfrom
benaadams:generic-featurecollection

Conversation

@benaadams
Copy link
Contributor

@benaadams benaadams commented Aug 22, 2017

Speed up the generic IFeatureCollection Get<T>/Set<T>

Pre

                 Method |     Mean |         Op/s |
----------------------- |---------:|-------------:|
     GetViaTypeOf_First | 12.96 ns | 77,136,481.9 | 
    GetViaGeneric_First | 22.38 ns | 44,679,211.4 | IHttpRequestFeature
    
      GetViaTypeOf_Last | 69.91 ns | 14,304,944.1 |
     GetViaGeneric_Last | 80.70 ns | 12,392,225.5 | IHttpSendFileFeature
     
    GetViaTypeOf_Custom | 76.84 ns | 13,014,603.2 |
   GetViaGeneric_Custom | 84.15 ns | 11,882,891.0 |
   
  GetViaTypeOf_NotFound | 76.29 ns | 13,108,494.2 |
 GetViaGeneric_NotFound | 84.44 ns | 11,843,124.1 |

Post

                 Method |     Mean |         Op/s |
----------------------- |---------:|-------------:|
     GetViaTypeOf_First | 12.70 ns | 78,733,231.9 |
    GetViaGeneric_First | 19.96 ns | 50,103,862.6 | IHttpRequestFeature
    
      GetViaTypeOf_Last | 66.28 ns | 15,087,099.9 |
     GetViaGeneric_Last | 33.59 ns | 29,771,919.4 | IHttpSendFileFeature
     
    GetViaTypeOf_Custom | 75.68 ns | 13,214,141.0 |
   GetViaGeneric_Custom | 44.21 ns | 22,617,022.7 |
   
  GetViaTypeOf_NotFound | 75.45 ns | 13,254,289.3 |
 GetViaGeneric_NotFound | 44.53 ns | 22,454,601.1 |

@benaadams benaadams force-pushed the generic-featurecollection branch from a16b183 to 9cb0409 Compare August 22, 2017 02:58
@benaadams benaadams changed the title Generic FastFeatureGet Faster IFeatureCollection.Get<TFeature> Aug 22, 2017
@benaadams benaadams force-pushed the generic-featurecollection branch 2 times, most recently from e8cc5fd to 8abe4b7 Compare August 22, 2017 04:50
@benaadams benaadams force-pushed the generic-featurecollection branch 5 times, most recently from f63b8f8 to 5820073 Compare September 24, 2017 18:27
@benaadams benaadams force-pushed the generic-featurecollection branch from 5820073 to 3265d46 Compare September 24, 2017 19:24
@benaadams
Copy link
Contributor Author

Updated, rebased

@benaadams
Copy link
Contributor Author

Using two arrays of struct wrappers for Type and object with a for loop (for high density on Type matching and to switch covariance off on the array) rather than a branching if/else is slower than the typeof version, so way slower than the generic version for _Last.

@ghost ghost removed the cla-already-signed label Nov 14, 2017
@davidfowl
Copy link
Member

This PR needs to do over. We refactored everything for http2. This change is interesting though, we should look at it again.

@benaadams
Copy link
Contributor Author

Rebased #2290

@benaadams benaadams deleted the generic-featurecollection branch February 7, 2018 19:10
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.

3 participants