Silk.NET icon indicating copy to clipboard operation
Silk.NET copied to clipboard

Remove local functions in maths - not needed in .NET 6, replace with just ifs

Open HurricanKai opened this issue 5 years ago • 9 comments

In 2.X, we used one local function per type (or type combination for methods with multiple Ts) per method to trick older .NET JITs to not go over the inlining budget. In .NET 6, the JIT prevents type specialization if branches (like the ones we use in the local functions today) from going over the inlining budget out-of-the-box, so this workaround isn't needed in 3.0 which is .NET 6 only.

HurricanKai avatar Sep 03 '20 06:09 HurricanKai

cc @Perksey anything you know already from your areas

HurricanKai avatar Sep 03 '20 06:09 HurricanKai

A lot of work will have to go into getting windowing to run on MAUI, as I'm sure that's going to be a popular request and probably how we'll do our mobile support in .NET 6 onwards.

Perksey avatar Sep 03 '20 06:09 Perksey

I'm guessing that MAUI will compile to native somehow, or at least that's the most performant way. So yeah, that goes hand in hand with banning reflection.

HurricanKai avatar Sep 03 '20 10:09 HurricanKai

No issues with reflection as .NET 6's mobile support will be salvaged from Xamarin (and MonoAOT ships everything so no issues with reflection there)

Perksey avatar Sep 03 '20 11:09 Perksey

Just going to pretend I didn't see that

HurricanKai avatar Sep 03 '20 11:09 HurricanKai

Not sure where else to write this down, but for 3.0 we should mark all core shared projects with <SupportedPlatform Include="browser" />

HurricanKai avatar Jul 08 '21 21:07 HurricanKai

Remove method splitting from maths.

Do you know what this refers to? I think we should close this issue in favour of cards on the 3.0 tracker if these are small things.

Perksey avatar Dec 31 '21 19:12 Perksey

I believe it refers to having many (local) methods per single math method.

HurricanKai avatar Dec 31 '21 21:12 HurricanKai

Will edit the issue text to just be that then seeing as everything SilkTouch is changing anyways.

Perksey avatar Jan 01 '22 01:01 Perksey

#988 is evidence that these are still needed due to code size, closing.

Perksey avatar Jan 21 '23 19:01 Perksey