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

NativeAOT possibly infinite generic expansion? #474

Closed
Shadow4walker opened this issue Dec 16, 2020 · 1 comment
Closed

NativeAOT possibly infinite generic expansion? #474

Shadow4walker opened this issue Dec 16, 2020 · 1 comment
Labels
area-NativeAOT-coreclr .NET runtime optimized for ahead of time compilation

Comments

@Shadow4walker
Copy link

again just like CoreRT With Avalonia 0.9.0 this time is happened with the preview version "0.10.0-rc1" it takes around 40Min To Compile a sample app instead the latest Released version 0.9.12 takes around 5Min
IDK if its caused by an infinite generic expansion or something else but its really frustrating to wait 40 Min in each time of Compile is there something else can be done to speed the process?
here's some examples on which the exception takes the most time waiting by diagnose the recursive generics

FIRST Hit

     Would mark [System.Collections]System.Collections.Generic.ICollectionDebugView`1..ctor(ICollection`1<!0>) but it's generic
     Would mark object.Finalize() but it's not usable for reflection invoke
     Would mark [System.Collections]System.Collections.Generic.ICollectionDebugView`1.get_Items() but it's generic
     Marking System.Collections.Generic.ICollectionDebugView`1._collection
     Would mark [System.Collections]System.Collections.Generic.ICollectionDebugView`1.get_Items() but it's generic
     Marking System.Drawing.Color.Empty
     Would mark object.Finalize() but it's not usable for reflection invoke
     Marking System.Collections.ArrayList.ArrayListDebugView._arrayList
     Would mark [System.Collections]System.Collections.Generic.IDictionaryDebugView`2..ctor(IDictionary`2<!0,!1>) but it's generic
     Would mark object.Finalize() but it's not usable for reflection invoke
     Would mark [System.Collections]System.Collections.Generic.IDictionaryDebugView`2.get_Items() but it's generic
     Marking System.Collections.Generic.IDictionaryDebugView`2._dict
     Would mark [System.Collections]System.Collections.Generic.IDictionaryDebugView`2.get_Items() but it's generic

====================================================================================
SECOND

     Would mark object.Finalize() but it's not usable for reflection invoke
     Marking System.Dynamic.ExpandoObject.KeyCollectionDebugView._collection
     Would mark object.Finalize() but it's not usable for reflection invoke
     Marking System.Dynamic.ExpandoObject.ValueCollectionDebugView._collection
     Would mark object.Finalize() but it's not usable for reflection invoke
     Marking System.Threading.Tasks.TaskScheduler.SystemThreadingTasks_TaskSchedulerDebugView.m_taskScheduler
     Would mark [System.Collections]System.Collections.Generic.DictionaryValueCollectionDebugView`2..ctor(ICollection`1<!1>) but it's generic
     Would mark object.Finalize() but it's not usable for reflection invoke
     Would mark [System.Collections]System.Collections.Generic.DictionaryValueCollectionDebugView`2.get_Items() but it's generic
     Marking System.Collections.Generic.DictionaryValueCollectionDebugView`2._collection
     Would mark [System.Collections]System.Collections.Generic.DictionaryValueCollectionDebugView`2.get_Items() but it's generic

====================================================================================
THIRD

     Compiling [System.Reactive]System.Reactive.Concurrency.CurrentThreadScheduler.Schedule<__Canon>(__Canon,TimeSpan,Func`3<IScheduler,__Canon,IDisposable>)...
     Would mark [System.Collections]System.Collections.Generic.DictionaryKeyCollectionDebugView`2..ctor(ICollection`1<!0>) but it's generic
     Would mark object.Finalize() but it's not usable for reflection invoke
     Would mark [System.Collections]System.Collections.Generic.DictionaryKeyCollectionDebugView`2.get_Items() but it's generic
     Marking System.Collections.Generic.DictionaryKeyCollectionDebugView`2._collection
     Would mark [System.Collections]System.Collections.Generic.DictionaryKeyCollectionDebugView`2.get_Items() but it's generic
     Would mark [System.Linq]System.Linq.SystemLinq_LookupDebugView`2..ctor(Lookup`2<!0,!1>) but it's generic
     Would mark object.Finalize() but it's not usable for reflection invoke
     Would mark [System.Linq]System.Linq.SystemLinq_LookupDebugView`2.get_Groupings() but it's generic
     Marking System.Linq.SystemLinq_LookupDebugView`2._lookup
     Marking System.Linq.SystemLinq_LookupDebugView`2._cachedGroupings
     Would mark [System.Linq]System.Linq.SystemLinq_LookupDebugView`2.get_Groupings() but it's generic
     Would mark object.Finalize() but it's not usable for reflection invoke
     Marking System.Linq.Expressions.Interpreter.InstructionList.DebugView._list
     Marking System.Linq.Expressions.Interpreter.InstructionList.DebugView.InstructionView
     Would mark object.Finalize() but it's not usable for reflection invoke
     Marking System.Text.RegularExpressions.CollectionDebuggerProxy`1<Match>._collection
     Would mark [System.Text.RegularExpressions]System.Text.RegularExpressions.CollectionDebuggerProxy`1.get_Items() but it's generic
     Would mark [System.Collections]System.Collections.Generic.DictionaryValueCollectionDebugView`2..ctor(ICollection`1<!1>) but it's generic
     Would mark object.Finalize() but it's not usable for reflection invoke
     Would mark [System.Collections]System.Collections.Generic.DictionaryValueCollectionDebugView`2.get_Items() but it's generic
     Marking System.Collections.Generic.DictionaryValueCollectionDebugView`2._collection
     Would mark [System.Collections]System.Collections.Generic.DictionaryValueCollectionDebugView`2.get_Items() but it's generic
     Would mark [System.Collections]System.Collections.Generic.DictionaryKeyCollectionDebugView`2..ctor(ICollection`1<!0>) but it's generic
     Would mark object.Finalize() but it's not usable for reflection invoke
     Would mark [System.Collections]System.Collections.Generic.DictionaryKeyCollectionDebugView`2.get_Items() but it's generic
     Marking System.Collections.Generic.DictionaryKeyCollectionDebugView`2._collection
     Would mark [System.Collections]System.Collections.Generic.DictionaryKeyCollectionDebugView`2.get_Items() but it's generic		 

====================================================================================
FOURTH

     Compiling [System.Linq]System.Linq.Enumerable+WhereSelectEnumerableIterator`2<System.Collections.Generic.KeyValuePair`2<System.__Canon,System.__Canon>,System.__Canon>.Select<KeyValuePair`2<__Canon,__Canon>>(Func`2<__Canon,KeyValuePair`2<__Canon,__Canon>>)...
     Would mark [System.Linq.Expressions]System.Linq.Expressions.ExpressionCreator`1.CreateExpressionFunc(Expression,string,bool,ReadOnlyCollection`1<ParameterExpression>) but it's generic
     Would mark object.Finalize() but it's not usable for reflection invoke
     Marking System.Threading.SpinLock.SystemThreading_SpinLockDebugView._spinLock
@jkotas
Copy link
Member

jkotas commented Dec 16, 2020

This is duplicate of #452.

I do not think that this is infinite expansion (it would never end). I believe that the problem is in layers of generic virtual methods.

@jkotas jkotas closed this as completed Dec 16, 2020
@jkotas jkotas added the area-NativeAOT-coreclr .NET runtime optimized for ahead of time compilation label Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NativeAOT-coreclr .NET runtime optimized for ahead of time compilation
Projects
None yet
Development

No branches or pull requests

2 participants