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

Conversation

pakrym
Copy link
Contributor

@pakrym pakrym commented Jun 1, 2017

Fixes: #500

@pakrym
Copy link
Contributor Author

pakrym commented Jun 1, 2017

Before:

    Method |        Mean |    StdErr |     StdDev |      Median |         Op/s | Scaled | Scaled-StdDev |  Gen 0 | Allocated |
---------- |------------ |---------- |----------- |------------ |------------- |------- |-------------- |------- |---------- |
      NoDI |   5.5142 ns | 0.0348 ns |  0.1908 ns |   5.4640 ns | 181348688.78 |   1.00 |          0.00 | 0.0035 | 24 B |
 Transient |  55.4727 ns | 0.3655 ns |  2.0019 ns |  54.8612 ns |  18026897.93 |  10.07 |          0.48 | 0.0015 | 24 B |
    Scoped | 118.1930 ns | 0.7217 ns |  3.9530 ns | 117.7722 ns |   8460736.43 |  21.46 |          0.99 |      - | 0 B |
 Singleton | 157.7186 ns | 5.1082 ns | 27.9789 ns | 174.8609 ns |   6340408.26 |  28.63 |          5.08 |      - | 0 B |

After:

    Method |        Mean |    StdDev |         Op/s | Scaled | Scaled-StdDev |  Gen 0 | Allocated |
---------- |------------ |---------- |------------- |------- |-------------- |------- |---------- |
      NoDI |   5.9400 ns | 0.1832 ns | 168350433.44 |   1.00 |          0.00 | 0.0035 |      24 B |
 Transient |  56.2400 ns | 1.4699 ns |  17780950.96 |   9.48 |          0.37 | 0.0015 |      24 B |
    Scoped | 128.1737 ns | 3.9677 ns |   7801911.84 |  21.60 |          0.91 |      - |       0 B |
 Singleton | 135.9294 ns | 3.8256 ns |   7356759.37 |  22.90 |          0.92 |      - |       0 B |

return null;
}

private IServiceCallSite ApplyScope(IServiceCallSite serviceCallSite, ServiceLifetime descriptorLifetime)
Copy link
Member

Choose a reason for hiding this comment

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

Change the name to ApplyLifetime, Scope has another meaning

Validate(descriptors);
}

private void Validate(IEnumerable<ServiceDescriptor> descriptors)
Copy link
Member

Choose a reason for hiding this comment

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

static?

@@ -680,5 +680,29 @@ public void DisposesInReverseOrderOfCreation()
Assert.Equal(outer.MultipleServices.Reverse(), callback.Disposed.Skip(1).Take(3).OfType<IFakeMultipleService>());
Assert.Equal(outer.SingleService, callback.Disposed[4]);
}

[Fact]
public void ResolvesMixedOpenClosedGenericsAsEnumerable()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

/cc @khellang this test fails on StructureMap

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep. That was expected (#500 (comment)). I'll see if I can do some magic internally to get it to work.


namespace Microsoft.Extensions.DependencyInjection.ServiceLookup
{
internal class FactoryService : IService, IServiceCallSite
internal class FactoryService : IServiceCallSite
Copy link
Member

Choose a reason for hiding this comment

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

FactoryCallsite

@pakrym pakrym changed the base branch from dev to rel/2.0.0-preview2 June 2, 2017 18:55
@pakrym pakrym merged commit ca88b00 into rel/2.0.0-preview2 Jun 5, 2017
pakrym added a commit that referenced this pull request Jun 5, 2017
pakrym added a commit that referenced this pull request Jun 6, 2017
@natemcmaster natemcmaster deleted the pakrym/nobody-would-take-this branch November 2, 2018 16:24
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.

4 participants