
Bing.com now runs on .NET Core - sebazzz
https://blogs.msdn.microsoft.com/dotnet/2018/08/20/bing-com-runs-on-net-core-2-1/
======
merb
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.

~~~
Yhippa
That is one thing I always admired about .NET from afar: there was generally
one fairly polished framework that you could reasonably trust. In Javaland I
feel like I sometimes I have to second-guess everything to make sure I'm using
the "best" implementation of something.

That and C# is an ISO standard which is pretty cool.

~~~
elboru
I'm a C# developer who has been learning React for the past year, and it
really is an exhaustive job to look for the right JS library for every case,
this is my process:

1\. Facing a code task.

2\. Asking myself, should I reinvent the wheel or should I look for a library?

3\. Google for libraries solving the task, open at least 5 npm/github tabs.

4\. For every tab, I should make sure the library is not too big for my
needs/popular/still being maintained/not too many open issues. -Closing the
tabs that didn't pass this step.

5\. Taking a look at documentation/examples to determine if it can solve my
problem. -Closing the tabs that didn't pass this step.

6\. Testing the library and see if I can make it work.

7\. Implement it in my project.

It's a really different environment, and it has its advantages, it's just that
Microsoft has spoiled me a little with their out of the box implementations.

~~~
growlist
As a dev that's trying to brush up on JS after neglecting it for years, it's
really hard to know where to start.

------
magnat
> 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
Thanks for the suggestion, I've modified the graphic.

~~~
stanislavb
It's still misleading unless you look for the specific numbers...

------
ericcholis
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
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
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
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.

~~~
scarface74
Just to confuse things even more, there is also .Net Standard.
([https://blogs.msdn.microsoft.com/dotnet/2016/09/26/introduci...](https://blogs.msdn.microsoft.com/dotnet/2016/09/26/introducing-
net-standard/)).

.Net Framework (Windows only), .Net Core and Xamarin are all implementations
of .Net Standard.

To add even more confusion, ASP.Net Core can run either on .Net Core or .Net
Framework.

~~~
bargl
I know I've over simplified this for myself. But the way that I look at it is
like so.

.Net Standard is an "Interface" \- No implementation behind the scenes just a
list of apis.

.Net Framework, .Net Core, Xamarin are all "classes" or implementations of
.Net Standard.

ASP.NET Core only relies on .NET standard which is implemented by both .Net
Framework and .Net Core. Which means it can run on both.

ASP.NET (Framework) does not rely on .Net Standard but directly links to the
implementation of .Net Framework. Which means those libraries can't run
anywhere and are instead limited to only .NET Framework.

I'm no Jon Skeet, or tech guru. So please take this explanation with a grain
of salt and if I'm wrong correct me as needed. This is just how I've wrapped
my head around it.

~~~
nlawalker
David Fowler (Microsoft engineer on ASP.NET Core) posted an "analogy in C#"
gist a couple years ago that is similar to yours, but in code. It's a couple
years old so is a bit out of date at this point, but the basic idea holds.

[https://gist.github.com/davidfowl/8939f305567e1755412d6dc0b8...](https://gist.github.com/davidfowl/8939f305567e1755412d6dc0b8baf1b7)

------
martinald
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?

~~~
swalsh
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.

~~~
snarfy
I remember all of the KRE, KVM, project.json, etc. It was pretty rough, and
that's from someone that's been using .net daily since the 1.0 beta many years
ago.

They've fixed all of that stuff.

------
daxfohl
I wonder if it's running on windows or linux. And whether they're using
ASP.NET core or rolled their own framework.

~~~
Bhilai
HTTP Response header say the server is running IIS 10.0 so its most likely
Windows Server 2016.

~~~
daxfohl
Interesting, I thought kestrel was supposed to be way faster than IIS. Wonder
why they stuck with IIS after going through all this.

~~~
davidgl
Kestrel needs a reverse proxy in front of it for SSL termination etc.
[https://docs.microsoft.com/en-
us/aspnet/core/fundamentals/se...](https://docs.microsoft.com/en-
us/aspnet/core/fundamentals/servers/?view=aspnetcore-2.1&tabs=aspnetcore2x)

~~~
benaadams
Doesn't need on for SSL; needs a reverse proxy if you want to do port sharing
(many apps on port 80/443 switched by host header) or Windows Auth.

You can also build your reverse proxy using Kestrel.

Though IIS is more battle tested so they may be using that as front line
server for such a high profile service as Bing

~~~
cm2187
Is it even wise to design a system that uses un-encrypted backend traffic? The
Snowden revelations did demonstrate that intelligence services are snooping on
those.

~~~
benaadams
Not over an actual network; but localhost or in-process it should be fine?
Though the in-process IIS hosting is ASP.NET Core 2.2 as it got bumped from
the 2.1 release
[https://github.com/aspnet/IISIntegration/issues/878](https://github.com/aspnet/IISIntegration/issues/878)

~~~
cm2187
ok but then it is not much of a load balancer.

~~~
benaadams
Meant for port sharing; multiple apps or subdomains switching either on host
header or path; as you can't have multiple processes listening on the same
port (80/443) on the same machine. Or changing which is run based on the path

------
icey
Wow, they got an eye-popping performance improvement from this change.

~~~
Analemma_
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.

~~~
christophilus
I think there's also c) .NET Core is OSS, and has had a lot of contributions
from the community for things that MS themselves didn't prioritize.

~~~
Analemma_
Yes, this is an excellent point I forgot. With closed-source, you only get to
make perf improvements if your manager decides there's not a more important
feature you should be working on instead.

------
kevindqc
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...](https://github.com/dotnet/coreclr/blob/48cb3fa29a63219a9669ae012eefca0bf5ce0091/src/System.Private.CoreLib/shared/System/SpanHelpers.T.cs#L608)

~~~
benaadams
char ref (managed pointer) is cast to byte ref
[https://github.com/dotnet/coreclr/blob/04d9b557ef8b7c60a1194...](https://github.com/dotnet/coreclr/blob/04d9b557ef8b7c60a1194d062c7c2ee6e41fd8c1/src/System.Private.CoreLib/shared/System/String.Comparison.cs#L27-L37)

Then it uses SpanHelpers.SequenceEqual for byte which is vectorized

[https://github.com/dotnet/coreclr/blob/04d9b557ef8b7c60a1194...](https://github.com/dotnet/coreclr/blob/04d9b557ef8b7c60a1194d062c7c2ee6e41fd8c1/src/System.Private.CoreLib/shared/System/SpanHelpers.Byte.cs#L862-L916)

~~~
Arnavion
>char is cast to byte

To be clear, char is not cast to byte (which would truncate). A char ref (ie a
char pointer) is cast to a byte ref (ie a byte pointer).

~~~
benaadams
Good point :) Updated

------
pestkranker
Are there resources that describes Bing web stack/infrastructure? Something à
la [http://highscalability.com/](http://highscalability.com/).

~~~
mjsabby
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
I know nobody who uses Bing to be honest. Am I wrong in thinking this?

~~~
rb808
I use bing all the time. The results are good enough and I get points for
amazon vouchers. "image searches" ahem work great too.

~~~
Saoshyant
Ah, yes, I too use Bing to search for images of a specific nature with some
frequency. It's quite likely the best search engine available for the...
higher arts.

I do not know if they have done it on purpose, but kudos to the Bing team
either way.

------
kuwze
I thought this was a really good post[0] on the networking performance
potential of .NET.

[0]: [https://dzone.com/articles/how-raygun-increased-
throughput-b...](https://dzone.com/articles/how-raygun-increased-throughput-
by-2000-with-net-c)

~~~
kjeetgill
Sort of? It's interesting work but I don't know if I'd frame it as "networking
performance potential of .NET".

The title is "How Raygun Increased Throughput by 2,000% With .NET Core (Over
Node.js)". From the article:

> In terms of EC2, we utilized c3.large nodes for both the Node.js deployment
> and then for the .NET Core deployment. Both sit as backends behind an NGINX
> instance and are managed using scaling groups in EC2 sitting behind a
> standard AWS load balancer (ELB).

They're comparing their Node.js vs C# versions behind ELB and NGINX. It's
barely touching the networking part of the stack directly. They gains are
almost definitely all from a stronger compiler story and a concurrency story.

They say themselves:

> Node is a productive environment and has a huge ecosystem around it, but
> frankly, it hasn’t been designed for performance.

------
funwie
.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
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
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
It would be great if they compare running bing on Linux vs Windows! Is there a
hidden gem somewhere?

~~~
mjsabby
Barring any bugs, the hope is that the code generated on Windows and Linux for
the same architecture will be very similar, modulo calling conventions and
ABI.

Then you come down to issues like Linux networking vs. Windows networking,
Disk I/O differences which are interesting but from a .NET perspective less so
in my opinion.

~~~
polskibus
It is very interesting to know if running .net core on Linux gives you better
performance than on Windows. If you don't get any perf. penalty then moving to
Linux saves you a lot in Windows Server licenses! And if Linux is faster then
there is really no reason to stay with Windows Server anymore.

~~~
manigandham
Bing is Microsoft, they likely do not pay for Windows licensing, and would
also rather work with the Windows team than switch to Linux.

~~~
polskibus
Of course Microsoft won't. THE outcome of the performance comparison is
important for all the other companies using .NET.

------
wpdev_63
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
just switch to. net core. "* core" is pretty googlable

------
h4b4n3r0
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
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.

~~~
h4b4n3r0
>> It's happening slowly but surely.

Exciting to hear. .NET is truly a diamond in the rough on the Linux side, its
only major problem seems to be catch-22 in the sense that few people use it
there, so the ecosystem is slow to come in.

------
some_account
". NET is applying an update, please return to Bing after reboot"

------
paulcarroty
Bing is completely mess as a search engine. I tried it 3 or 4 times and every-
time the context of results was long away from desired.

I heard Bing good for porn, it's probably the one strong side, LOL.

