jeme commented on issue #1041: URL: https://github.com/apache/lucenenet/issues/1041#issuecomment-2518027802
> Secondly, and more importantly, when the `netstandard2.0` target is chosen, all of its dependencies can only target `netstandard2.0` or lower. If the runtime is `net8.0` or `net9.0` and Lucene.Net is `netstandard2.0`, it will no longer call the hardware intrinsics APIs that didn't exist until `net6.0` because it will load `System.Memory` and `J2N` assemblies that target `netstandard2.0`. System.Memory and J2N both use hardware intrinsics only if the target is .NET Core. And this goes well beyond those two dependencies. Please lets keep the talk about netstandard2.0 vs > As for the difference between `net462` and `netstandard2.0`, the performance advantage is not as significant in that case. Although, there are still a few optimizations with having a native runtime target over a .NET Standard target. > > Do I think that we should drop `netstandard2.0`? Not at this time. But I think we should consider doing it before we drop `netstandard2.1` because of the missing APIs on `ConditionalWeakTable<TKey, TValue>`. However, as long as Microsoft is still targeting `netstandard2.0` it is a strong indicator that we should be, as well. > > That being said, I think we should actively discourage anyone from using `netstandard2.0` as a way to target both .NET Framework and .NET Core, because doing so loses several of the performance advantages of using .NET Core (at least for our class libraries and any class libraries we depend on). That is, unless you are swapping in the .NET Core assembly into the final build (although, there may be some minor API differences where you could get burned by doing that). No, this is not what happens. At least not in my testing. And I have teste both a .NET 8 and .NET 4.8 scenario. Given I have a .NET 8 project that references a .NET Standard 2.0 Project or Package that references Lucene, I DON'T get the Lucene .NET Standard 2.0 image/dll, I get the one from .NET 8.0. Given I have a .NET 4.8 project that references a .NET Standard 2.0 Project or Package that references Lucene, I DON'T get the Lucene .NET Standard 2.0 image/dll, I get the one from .NET 4.6.2.  I also did binary comparisons. Yes, I WON'T say that I am not a little surprised my self >.<... But... Try it out your self. Now -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
