Skip to content
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

Avoid wasteful compilation of the same cached expression by multiple threads #208

Closed
dadhi opened this issue Jan 10, 2020 · 1 comment
Closed
Labels
bug Something isn't working enhancement New feature or request performance
Milestone

Comments

@dadhi
Copy link
Owner

dadhi commented Jan 10, 2020

Found in #205

We should park the other competing threads until the first thread will compile the cached expression. Maybe using ManualResetEventSlim or similar mechanism.

@dadhi
Copy link
Owner Author

dadhi commented Jan 11, 2020

Given the current pipeline #199 (comment) and the performance numbers we may consider to compile delegate by the first thread and proceed to interpret by the competing threads until the delegate is available.
It seems a better option because only one thread will slow down, others will be responsive. Then eventually all threads will benefit from the compiled delegate speed-up. Even better that we don't need any blocking synchronization.

dadhi added a commit that referenced this issue Jan 15, 2020
@dadhi dadhi closed this as completed in 4da18a3 Jan 15, 2020
dadhi added a commit that referenced this issue Jan 20, 2020
* fixing keyed cache  #205 results and fixed #208

* first compiling draft for the #101

* fixed spelling in DIZero readme

* added ResolveGenerated to Resolve

* ResolveGenerated for the keyed service

fixing CI - removing System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute

* added ResolveMany and the passing test for the Example

* rc

* moar

* renaming and package related stuff

* tests WithoutFEC

* fix source package

* add smarter initial factory id

* fix net40 target

* WIP adding to the ASP .NET Core sample the CompileTimeDI

* added troubleshooting tip

* moving the DIZero stuff to CompileTimeDI folder including example

updating release notes

* added Asp NET Core 3.1 Mvc example - WIP

* cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request performance
Projects
None yet
Development

No branches or pull requests

1 participant