top | item 17801616

Bing.com now runs on .NET Core

375 points| sebazzz | 7 years ago |blogs.msdn.microsoft.com | reply

152 comments

order
[+] merb|7 years ago|reply
Somehow I actually fell in love with .NET Core 2.0. While their naming is still confusing and it's hard to know what will come next. I found myself amazingly productive with Razor Pages. It's really cool if you don't need an SPA and you could do everything pretty damn fast. It's like WebForms, but without the Microsoft specifics and instead relies on the good old html5 part to make an app great.
[+] magnat|7 years ago|reply
> That is a 34% improvement

That graph is completely misleading then. I can understand why they don't want to show actual y-axis values, but at least put relative values on that axis. Even "60%" and "100%" would do.

[+] mjsabby|7 years ago|reply
Thanks for the suggestion, I've modified the graphic.
[+] ericcholis|7 years ago|reply
I like the fact that they are highlighting the individual Pull Requests. It's a good reminder that .NET Core is indeed open to community changes.
[+] Someone1234|7 years ago|reply
Indeed. But it is worth noting that most of those individual pull requests were from Microsoft employees.

It is still awesome that the community can comment, and Microsoft does take community changes regularly for .Net Core, VS Code, etc.

[+] sevensor|7 years ago|reply
Not a .NET developer, so apologies for the dumb question, but why did MS release a second open source .NET implementation around the same time as they acquired Xamarin? Do .NET core and Mono compete with one another? Do they serve complementary roles? Why would I choose one over the other?
[+] headmelted|7 years ago|reply
I'll take a stab at this.

.NET Core and Mono are not exactly analagous. A better comparison historically would have been Mono to .NET Framework (i.e. classic .NET).

.NET Framework is a fairly expansive set of standard libraries bundled with a runtime - it's commonly used and well-supported, and dates back to about 2001, give-or-take a beta or two. There's a lot of current and legacy applications built on this out in the wild.

.NET core is effectively a do-over for the longer term in the form of a minimal set of dependencies that imports more of the standard library separately. There's a couple of reasons for doing this - primarily the parts that have been abstracted out mean that .NET core runs in a lot more places than the classic framework (including natively on devices like the Raspberry Pi, for example), and can also be (and is) fully open-source (the classic framework is mostly open-source these days as it is, but licensing problems meant that not every part of the toolchain could be opened up).

There's also the question of expectations when it comes to community changes. .NET Framework was adopted in many quarters on the basis that it was developed by Microsoft directly, and bureaucratically opening it up to community changes after the fact becomes problematic due to the massive number of stakeholders and their expectations.

I'm sure someone else can add more info but as I understand it this is the gist.

[+] benaadams|7 years ago|reply
For server on Windows, Linux and MacOS you'd probably sway .NET Core.

For client on Windows, UWP is .NET Core, and WinForms or WPF currently .NET Framework. Though .NET Core 3.0 is meant to bring the full set of Windows UI stacks to .NET Core https://blogs.msdn.microsoft.com/dotnet/2018/08/08/are-your-...

For Tizen you'd also use .NET Core

For client on macOS or Linux you use Mono

For games you'd probably use Unity (Mono based)

For iOS, tvOS, watchOS, Solaris, Android, Solaris, IBM AIX and i, BSD (FreeBSD, OpenBSD, NetBSD), PlayStation 4, XboxOne, WebAssembly you'd use Mono

Can still use Mono for client on Windows and the ASP.NET Core stack is quite happy running on Mono on the server; but they have different focuses.

If you were building a library you'd target the .NET Standard 2.0 "contract" and it would cover all the runtimes.

[+] manigandham|7 years ago|reply
.NET Framework was first, the major install on Windows only. Mono came after, to try and replicate .NET on non-Windows and with an open-source approach. Eventually .NET Framework code was open-sourced (at least read only in the beginning), which also helped Mono get better.

.NET Core was created to take the aging .NET Framework and rebuild for a faster, easier deployment, quick release cycle, and cross-platform on Linux and Mac OS; without hurting the decades of backwards compatibility.

Mono meanwhile became the base for Xamarin for mobile apps and Unity as a gaming engine. Even though Microsoft acquired Xamarin, Mono already had much uptake in both of these scenarios that it didn't make sense to attempt replacing it, so now we have Mono for mobile+games and .NET Core for the rest.

.NET Framework will still be around for a decade but is effectively retired and .NET Core 3.0 will fill in any remaining gaps for Windows apps that still need the full framework today.

[+] mrblah|7 years ago|reply
My understanding is that Mono is being billed as a client framework (Monogame, Xamarin, Unity, Blazor) while Core is more for the server/systems target. To add to the confusion, ".Net Standard" is a library compilation target that should work everywhere (even the legacy Windows-only .Net Framework). Interestingly, the newly MIT-licensed Xenko game engine compiles to .Net Standard libraries which is how it supports so many platforms (via barebones launcher/shim projects for whichever framework implementation is desired). Edited for clarity, thx.
[+] sremani|7 years ago|reply
From what I remember reading a post or listening to podcast is .net core is "server-centric" and mono is "client-centric" also relative "foot-print" in size.
[+] mandeepj|7 years ago|reply
This is a really great question, in fact. Normally, people go with what's available. Without connecting the dots.
[+] dep_b|7 years ago|reply
.Net core replaces Mono.
[+] martinald|7 years ago|reply
I'm a huge fan of C# and ASP.net, but this transition hasn't went as smoothly as I hoped.

I tried .NET core a lot pre-1.0 and it seemed really fragile (especially on Mac and Linux, which was my main excitement around it).

As I was a bit nervous about that, I started a new project in 'classic' .NET w/ MVC5. It however seems a lot of projects are migrating rapidly to .NET Core and leaving support for legacy projects recently.

It does seem to be a giant pain to migrate a legacy asp.net app to asp.net core (very manual). Anyone have any tools/advice on this process?

[+] markmark|7 years ago|reply
Porting to 1.0 was a pretty big headache, there was a lot of stuff in full .NET that wasn't in 1.0, and a lot of open source libs hadn't been ported yet.

In 2.0 they had a bit of a rethink about how stripped down Core was going to be and added a heap of stuff in, plus a lot more (most?) big open source libs have been ported. So porting legacy apps is much easier.

However I don't see any point porting a legacy app unless there is something in core you want. Perhaps you'd like to move your app over to running on Linux servers? At my previous company we ported parts of our product so that we could sell cross-platform support without needing our users to install mono.

[+] swalsh|7 years ago|reply
I was an early adopter of .net core. It definitely had its quirks in the beginning. Recently I gave it another go, it's really improved a lot. Like it's production ready now. I'd say pick it up again.
[+] sebazzz|7 years ago|reply
.NET core has several compatibility packages you can use.

However, once you have Web Forms in your project there is no way forward but to rewrite the Web Forms pages.

[+] DenisM|7 years ago|reply
Why even bother? Mvc5 still works well, and will continue working well for the years to come. Is there a pressing need to migrate?

I’ve decided to wait it out.

[+] daxfohl|7 years ago|reply
I wonder if it's running on windows or linux. And whether they're using ASP.NET core or rolled their own framework.
[+] icey|7 years ago|reply
Wow, they got an eye-popping performance improvement from this change.
[+] Analemma_|7 years ago|reply
I get the feeling that there has been a lot of low-hanging optimization fruit in .NET that went unaddressed because a) the original compiler was too complicated to change and b) there was no pressure to improve it because it only ran on Windows and there were no real competitors.

a) was addressed by Roslyn, which is apparently much more manageable, and now that .NET is supposed to run everywhere, it has to have competitive performance. Hence the big gains.

[+] neilsimp1|7 years ago|reply
It is, but I wonder what they're measuring on Y-axis. I just says `(actual values omitted)`.
[+] kevindqc|7 years ago|reply
The first commit says "Vectorization of string.Equals". It now uses SpanHelpers.SequenceEqual. How is that vectorized when it's just an unrolled loop from what I see? Does vectorization not mean using SIMD instructions? It also means improving data dependencies?

https://github.com/dotnet/coreclr/blob/48cb3fa29a63219a9669a...

[+] wolf550e|7 years ago|reply
Maybe there is an autovectorizer in the compiler that recognizes the shape of that loop and uses SSE to do it 16 bytes at a time instead of 8 at a time?
[+] Kirth|7 years ago|reply
The CLR/runtime to optimizes that code into SIMD instructions, if the hardware allows for it.
[+] pestkranker|7 years ago|reply
Are there resources that describes Bing web stack/infrastructure? Something à la http://highscalability.com/.
[+] mjsabby|7 years ago|reply
Bing is huge both in codesize and technologies used, but most of it is a flavor of Windows Server 2016 (soon 2019) + http.sys + C# + Razor + TypeScript for Frontend. C#/C++ for middle and lower tiers.
[+] dasanman|7 years ago|reply
I know nobody who uses Bing to be honest. Am I wrong in thinking this?
[+] cbHXBY1D|7 years ago|reply
DuckDuckGo, Alexa, and Cortana use it.

It gets about 21% of the search market.

[+] funwie|7 years ago|reply
.Net Framework is windows only

Mono is open source port of .Net Framework to non-windows platforms (linux, mac os)

.Net Core is cross platform (like Java but without GUI features for now)

.Net Standard for libraries shared by all 3 above.

[+] tracker1|7 years ago|reply
Definitely interesting... I think this speaks mostly to having a direct compile option for .Net Core that works well more so than the platform as a whole.

Personally, my first past at most things these days would be with Node.js simply because of productivity, but it's nice to see more options for performance growth as needed.

[+] markbnj|7 years ago|reply
Years ago I spent a lot of time trying to convince some of our large bank customers that we could run their stuff on Windows NT instead of SunOS or AUX or whatever by noting that microsoft.com ran on NT. I'm not even sure if it was actually true at the time, now that I think about it.
[+] polskibus|7 years ago|reply
It would be great if they compare running bing on Linux vs Windows! Is there a hidden gem somewhere?
[+] wpdev_63|7 years ago|reply
They should have renamed .net to something else. Now we have to deal with the same issues as the python 2/3 but maybe even worst as it's harder to tell which apis are available looking at sample code.
[+] yread|7 years ago|reply
just switch to. net core. "* core" is pretty googlable
[+] h4b4n3r0|7 years ago|reply
Bing folks, are you running this on Linux? Common problem a few years ago was that perf of the Linux version of Core sucked compared to Windows. The only way to fix that is through serious dogfooding. I’m wondering to what extent Microsoft is committed to such dogfood on Linux.
[+] mjsabby|7 years ago|reply
Windows Server 2016. All the improvements in the post that helped us are the same on Linux. I will agree though there's more dogfooding to be done. It's happening slowly but surely.
[+] benaadams|7 years ago|reply
Techempower Benchmarks all run on Linux and they are quite focused on the performance of them https://www.techempower.com/benchmarks/#section=test&runid=9...

7+ million requests per second on linux for a single server (maxing out a 10GBps network) isn't to shabby ;)

Also they run continuous benchmarks for all platforms in a wider range of tests https://github.com/aspnet/Benchmarks

With the results being public at https://aka.ms/aspnet/benchmarks