dotnet / interactive

.NET Interactive combines the power of .NET with many other languages to create notebooks, REPLs, and embedded coding experiences. Share code, explore data, write, and learn across your apps in ways you couldn't before.
MIT License
2.89k stars 387 forks source link

Is there any optimization option when running c# codes? #83

Open faruknane opened 4 years ago

faruknane commented 4 years ago

Are we enabled to run C# codes with an optimized way in jupyter notebook? There is a property named "Optimize Code" in Visual Studio to let the compiler knows whether the code will be optimized or not. Something like this do you provide us?

I'm asking this feature because there is x10 (for loop only small benchmarking) performance gap between Try .Net and .Net Core (Optimize Code is enabled), and x2 performance gap when Optimize Code is disabled.

I also develop a deep learning library in .NET Core. I have to know and care about performance issues.

faruknane commented 4 years ago

I hope I didn't ask something wrong

jonsequitur commented 4 years ago

Not at all, it's a good question. We're not looking deeply into performance optimization at this stage, but we will as we stabilize the code. We do have support for loading native libraries from NuGet packages, if that's helpful.

faruknane commented 4 years ago

I will look into that, thanks. Anyway with the current state, it's probably far better than python.

SeidChr commented 3 years ago

Just tried to run a BenchmarkDotNet benchmark in a interactive notebook. It complains about non-optimized compilation. An option to just pass compiler-parameters would be great, so that i can just enable this optimization when required.