-
Notifications
You must be signed in to change notification settings - Fork 193
Conversation
Also needs aspnet/HttpAbstractions#501 to be real
Also needs aspnet/HttpAbstractions#501 to be real
Also needs aspnet/HttpAbstractions#501 to be real
1d6fcaf
to
e4f4748
Compare
{ | ||
void CheckFeaturesRevision(); | ||
void ReplaceFeatures(IFeatureCollection features); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UpdateFeatures
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
e4f4748
to
1300077
Compare
Also needs aspnet/HttpAbstractions#501 to be real
|
||
_authenticationManager?.UpdateFeatures(features); | ||
_connection?.UpdateFeatures(features); | ||
_websockets?.UpdateFeatures(features); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these lazy sub-objects be cleared out per request? Only some requests will need them. If they don't get cleared then eventually every pooled HttpContext will have all of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Paid the price; fairly small, are a defined size (rather than an unknown user code type) - might as well? (Happy either way)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shrug It's a probability question. We can figure it out based on profiles later.
|
||
namespace Microsoft.AspNet.Http.Features | ||
{ | ||
public interface IFeatureManager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this new public interface?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, but would be implementing without contract; which is probably fine :)
Removed.
@benaadams We need some tests for this to make sure all of our features properly update and nothing is cached (unexpectedly). |
66ccc94
to
e77d0d2
Compare
Thinking future proofing... reflection to discover interfaces and make sure they are null? |
@@ -9,7 +9,7 @@ namespace Microsoft.AspNet.Http.Features.Internal | |||
{ | |||
public class QueryFeature : IQueryFeature, IFeatureCache | |||
{ | |||
private readonly IFeatureCollection _features; | |||
private IFeatureCollection _features; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to these Feature classes can be reverted, especially _features. ResetFeatures doesn't matter much one way or the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Looking good, but yes it still needs some tests. |
Also needs aspnet/HttpAbstractions#501 to be real
Added test; with it, found some areas where it wasn't actually caching and some where it was over clearing, so fixed those too. |
8b2d67d
to
aed0185
Compare
@@ -147,6 +150,140 @@ public void SetItems_NewCollectionUsed() | |||
Assert.Same(item, context.Items["foo"]); | |||
} | |||
|
|||
#if DNX451 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this ifdefed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coreclr doesn't have IsInterface
in reflection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, are some extension methods on .GetTypeInfo()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enabled for all frameworks now
aed0185
to
47216af
Compare
} | ||
} | ||
|
||
void IFeatureCache.SetFeaturesRevision() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the explicit implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't want someone to call it; as it says "mark cache as up to date; but don't check it" - its only valid use is as part of the Interface contract.
Changes made |
940651b
to
cc549e2
Compare
Rebased and merged. |
w00p! 👍 |
Also needs aspnet/HttpAbstractions#501 to be real
No point in pooling if you can't actually update stuff; allows for a saving of 959KB per 4k requests
See: https://github.com/aspnet/benchmarks/pull/34/files#diff-a48f9d66e0bc9b9c9ec15dae230d8e50R167
in aspnet/Benchmarks#34 for specific usage
Resolves #502
Resolves #402
Allocation details when pooling (in benchmarks repo), usual stuff, 4k requests, 16 pipelined, using FF
Pre-allocations for DefaultContext 1.12MB
Post-allocations for DefaultContext 160KB
Almost all of which is logging scope