-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
4.1.0 Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. #205
Comments
Hi @Havunen You are just in time, thanks for finding. |
@dadhi |
Thanks, this is valuable - some of my assumtions were surely wrong. Will check. |
Awesome, I'm waiting for next release! :) |
@Havunen Did you see the results I've added in comment in LoadTest Program.cs? |
Yes I noticed it. The test takes for a while because it creates lots of parallel load to verify there is no dead-lock / locking issues. I will run the tests now and compare it to previous DryIoc version to see if there is performance change. |
@dadhi Did you notice that when running LoadTest using "WithoutFastExpressionCompiler" -option its now crashing to new exception:
|
I did not test it without FEC, but now will do. thanks again. I have a clue regarding this exception. |
@Havunen , The problem with compilation is not only compilation time but multiple threads attempting to compile the same expression wasting the resources and moreover competing over resources slowing everythijg even further (cpu was 100% loaded). |
I think its real-world problem in web applications, multiple threads can start resolving same controller same time? It would be good to get it fixed. In the load test I tried to compile and cache everything before the actual parallel work starts. I thought DryIoc works so that first time it resolves controller it interprets the result and then next time it caches it. Doesn't it work like that anymore? |
The lines you've mentioned should work as expected , I will add stopwatch to track how much time it takes. |
I have documented the exact pipeline here #199 (comment) |
I think, here is the way to go for now #208 (comment) |
Feeling dumb, I've fixed another issue with the keyed service and it started to work. |
I think ideally it would be nice to run LoadTest using all possible Configurations, but then it would take even longer to finish... |
I have run it locally with and without FEC and the times are both faster (~ 7 and 10 minutes). I have added the results to the source and will push it later. |
Here the results: /*
* The results after fixes on my 8750h machine:
*
* - Validation finished - 00:00:27.39
*
* - ResolveAllControllersOnce of 156 controllers
* -- Default - 1st time: 0.2001231 seconds, 2nd time (cache entry compilation): 4.8156956 seconds (!!! - FEC is 4 times faster)
* -- WithoutFEC - 1st time: 0.2052857 seconds, 2nd time (cache entry compilation): 16.4215528 seconds
* -- WithUseInterpretation - 1st time: 0.20758 seconds, 2nd time (cache entry interpretation): 0.1651708 seconds
*
* - Starting compiled + cached tests:
* -- Load Test Finished - 00:00:37.35; WithoutFEC: 00:00:33.65; WithUseInterpretation: 00:00:58.54;
* -- Randomized Load Finished - 00:07:42.93; WithoutFEC: 00:07:49.95; WithUseInterpretation: 00:08:07.61;
*
* - Starting cold run tests
* -- Load Test Finished - 00:00:41.93; WithoutFEC: 00:00:50.20; WithUseInterpretation: 00:00:59.72;
* -- Randomized Load Finished - 00:07:53.44; WithoutFEC: 00:08:18.08; WithUseInterpretation: 00:08:20.03;
*/ |
hmm, in the second section
Does that mean FEC compiled code executes slower than FEC (linq) compiled code? |
I am not sure, may be I did something on my machine while testing or just exchanged the results by mistake. I run each test only once. |
I tested it on my machine too and linq compiled code execute about 25% faster, no idea why :( IL code seems very simple... maybe there is a catch somewhere |
Thanks for the testing |
* 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
DryIoc 4.1.0 is throwing exception for load test.
See updated pull request to reproduce the problem:
#165
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
The text was updated successfully, but these errors were encountered: