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

core: update .net7.0 #13876

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

core: update .net7.0 #13876

wants to merge 3 commits into from

Conversation

ngosang
Copy link
Member

@ngosang ngosang commented Jan 7, 2023

TODO:

  • Remove or replace AutoMapper => They are not compatible with .Net/Mono anymore => core: remove automapper #13879
  • Profile the memory usage. it has increased a lot vs .net6.0

This error when I search something

01-07 22:01:04 Error System.TypeInitializationException: The type initializer for 'Jackett.Common.Utils.MapperUtil' threw an exception. System.TypeInitializationException: The type initializer for 'Jackett.Common.Utils.MapperUtil' threw an exception.
 ---> System.ArgumentException: GenericArguments[0], 'System.Int32', on 'T MaxFloat[T](System.Collections.Generic.IEnumerable`1[T])' violates the constraint of type 'T'.
 ---> System.Security.VerificationException: Method System.Linq.Enumerable.MaxFloat: type argument 'System.Int32' violates the constraint of type parameter 'T'.
   at System.RuntimeMethodHandle.GetStubIfNeeded(RuntimeMethodHandleInternal method, RuntimeType declaringType, RuntimeType[] methodInstantiation)
   at System.Reflection.RuntimeMethodInfo.MakeGenericMethod(Type[] methodInstantiation)
   --- End of inner exception stack trace ---
   at System.RuntimeType.ValidateGenericArguments(MemberInfo definition, RuntimeType[] genericArguments, Exception e)
   at System.Reflection.RuntimeMethodInfo.MakeGenericMethod(Type[] methodInstantiation)
   at AutoMapper.TypeDetails.<>c__DisplayClass28_1.<BuildPublicNoArgExtensionMethods>b__10(MethodInfo extensionMethod)
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Enumerable.ConcatIterator`1.MoveNext()
   at System.Linq.Enumerable.SelectManyIterator[TSource,TCollection,TResult](IEnumerable`1 source, Func`2 collectionSelector, Func`3 resultSelector)+MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.HashSet`1.UnionWith(IEnumerable`1 other)
   at System.Linq.Enumerable.UnionIterator`1.FillSet()
   at System.Linq.Enumerable.UnionIterator`1.ToArray()
   at AutoMapper.TypeDetails.BuildPublicNoArgExtensionMethods(IEnumerable`1 sourceExtensionMethodSearch)
   at AutoMapper.TypeDetails..ctor(Type type, ProfileMap config)
   at AutoMapper.ProfileMap.TypeDetailsFactory(Type type)
   at AutoMapper.Internal.LockingConcurrentDictionary`2.<>c__DisplayClass2_1.<.ctor>b__1()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at AutoMapper.Internal.LockingConcurrentDictionary`2.GetOrAdd(TKey key)

@ilike2burnthing
Copy link
Contributor

ilike2burnthing commented Jan 8, 2023

Resolved a conflict caused by d0ebdea

And again for 137e112

@Gauvino
Copy link

Gauvino commented Feb 8, 2023

when merging all of the pr ?

@ilike2burnthing
Copy link
Contributor

When @ngosang is free. There's no rush.

@Gauvino
Copy link

Gauvino commented Feb 8, 2023

yes your right im just hopping search are gonna be such faster with net.7 and all of the other pr

@Qstick
Copy link
Contributor

Qstick commented Feb 19, 2023

yes your right im just hopping search are gonna be such faster with net.7 and all of the other pr

Probably not the case that anything will be MUCH faster with net7.

Net7 also is a bit of a monster with resource usage compared to net6 in our testing (ngosang also mentioned similar above).

@ngosang
Copy link
Member Author

ngosang commented Mar 20, 2023

@mynameisbogdan You may be interested in finishing this PR.

@goremykin
Copy link
Contributor

yes your right im just hopping search are gonna be such faster with net.7 and all of the other pr

Probably not the case that anything will be MUCH faster with net7.

Net7 also is a bit of a monster with resource usage compared to net6 in our testing (ngosang also mentioned similar above).

And that surprised me a lot, because .net team made a lot of cool optimizations in .net 7. So I expected at least the same memory usage or less...
They released some minor bugfix releases, I will profile with the latest one.

@goremykin
Copy link
Contributor

goremykin commented Mar 21, 2023

I didn't profile much, but in my case with .net 7 it consumes a bit more memory (5-8% in my scenario) than with .net 6.
@Qstick, could you provide steps to get the same huge usage?

Btw, Rider showed a warning about vulnerable dependencies:
https://devhub.checkmarx.com/cve-details/CVE-2019-0548/
https://devhub.checkmarx.com/cve-details/CVE-2019-0815/

As I see we need these deps for 4.6 projects, right? Is there any reason to support such a legacy framework?

@Qstick
Copy link
Contributor

Qstick commented Mar 21, 2023

@goremykin

The comment for Jackett was in this original post here

Profile the memory usage. it has increased a lot vs .net6.0

My comment was around the core arr programs and services, we've decided against moving to net7 and will move to net8 from net6 as we discussed in the Sonarr thread.

@ilike2burnthing ilike2burnthing mentioned this pull request Jun 17, 2023
2 tasks
@txtsd
Copy link

txtsd commented Dec 29, 2023

My comment was around the core arr programs and services, we've decided against moving to net7 and will move to net8 from net6 as we discussed in the Sonarr thread.

Is this still the case, or are we sticking with .NET 6.x for the foreseeable future?

@ilike2burnthing
Copy link
Contributor

ilike2burnthing commented Jan 9, 2024

dotNET 8 is out now, so if there's to be any change I'd assume it would be to that. No plans here though.

@ilike2burnthing

This comment was marked as off-topic.

@txtsd
Copy link

txtsd commented Jan 26, 2024

dotNET 8 is out now, so if there's to be any change I'd assume it would be to that. No plans here though.

Yes that's what I meant. Brain wasn't braining so my sentence was ambiguous.

If no one else is working on it yet, I'll try and see if I can do the port to dotNET 8.

@mynameisbogdan
Copy link
Contributor

dotNET 8 is out now, so if there's to be any change I'd assume it would be to that. No plans here though.

Been testing it today with another app, and so far I'm not happy with it.

@ilike2burnthing
Copy link
Contributor

More high memory usage issues?

@mynameisbogdan
Copy link
Contributor

The build and run in my IDE works in 1 of 100 cases, but somehow the executable build by Rider can be run in cli without issues.

But yea, I noticed the memory usage is more by ~50% and also higher CPU usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants