Hacker Newsnew | past | comments | ask | show | jobs | submit | whb07's commentslogin

You should try to get a job in Azure, you’d feel right at home!

.net462 baby!

More like 4.6.2


Very little, as in fingers in hand, little in Azure


Meanwhile, I recently proposed doing the work of updating the runtime versions from .netframework over to even .net5+ to save $millions/quarter.

I ran benchmarks, showing 2-10x+ improvements.

Got told, “lol no, this service is unlike Bing”. For context, Bing has amazing blogs on this*.

This, btw is inside networking for Azure…

Not sure at what point I should stop caring. Could easily improve operating expenses to the tune of hundreds/billions per year if they applied this across Azure.

https://devblogs.microsoft.com/dotnet/bing-com-runs-on-net-c...


I’m going to get downvoted for stating the obvious but …:

Lots of comments talking about “but US subsidiary, still has to follow US laws if mandated”

If I added the amount of sources where the EU imposes something on a non-EU company here it would crash the server.


Just exclude EU user. Block if from EU access and nobody will touch you.

You want to handle our data?

Obey our rules.


By saying "EU imposes something on a non-EU company", are you in fact referring to enforcing laws that are publicly known about? That seems like a totally different scenario to someone in the U.S. deciding that they need access to data in the EU due to some nebulous concern about national security and the company involved not even being allowed to openly discuss it.


Companies must adhere to the law where they are headquartered and where they are physically doing business. In particular court orders apply to them from either/both jurisdictions.

Always has been, always will be.


To be explicit this is a problem with the system, whereby an arbitrary thing can demand by force something.

I wish EU/US et al wouldn’t do this but they do. Let’s further the comments outside this point.


How is your comment relevant to EU users (the actual topic)?


It’s not, if you look at his X account, he talks about his work adding on the CUDA parts


Vultr has gpus and locations in Miami.

Good pricing and easy to spin up/down machines.


Sovereign immunity needs to be rid off entirely.

This all stems from the idea that God anointed the king, therefore he can do no wrong.

Except we know that humans are corrupt, malevolent, etc.

All individuals/offices in government should be liable for their actions.


I’ve found significant code in c/c++ where bitwise operations are done for things like division etc by shifting a certain way.

I Can imagine in the past, this was “faster”, yet clang/gcc can emit the same by just writing a basic A/B function.

Seems the win goes to readability by reducing some of these old school hacks.

What say you, greybeards ?


Oh definitely. Some of this goes back to my 6502 assembly days when there was no hardware multiply instruction. So to multiply by 40, for example. I would shift right 3 bits, store the result, shift right 2 more bits and add the stored result.

Similarly, a fast divisibility test (we’ll assume we’re dividing n by some odd prime p):

1. Shift the bits of p right so that there is a 1 in the last position.

2. If n = p then pn, if n < p then pn, otherwise continue.

3. Subtract p and go back to step 1.

(One of my ADD habits during meetings is to find the prime factors phone numbers or anything else very long. I do something similar with the numbers in decimal, but for this, I’ll subtract multiples of the potential divisor to get 0s at the end of the number in decimal. I remember co-workers puzzling over a piece of paper with my notes I left behind in a conference room trying to figure out what the numbers represented and how the process worked.)


Left, you would (obviously, this is a typo) shift left. And 3 followed by 2 since 1<<3 is 8, and 1<<5 is 32 and 8+32 is 40.


Depends on the situation. The compiler is smart, but in a way it's also dumb. It's very good at recognizing certain patterns and optimizing them, but not all patterns are recognized, and thus not all optimizations are applied, let alone consistently applied.

For example, see the article and discussion on Bitwise Division from two days ago: https://news.ycombinator.com/item?id=34981027


One thing to consider is that the compiler can't simply replace a division by just a right shift for signed variables (it will round towards -inf for negative numbers), so even today there's a tiny bit of benefit of explicitly using shifts if you know that the number can't be negative (and the compiler can't prove it) or you don't care about the rounding (https://godbolt.org/z/vTzYYxqz9).

Of course that tiny bit of extra work is usually negligible, but might explain why the idiom has stuck around longer than you might otherwise expect.


If the number can't be negative surely you should be using unsigned ints?


I only have a little grey in my beard so far, but like all optimizations it heavily depends on context. My broad rule of thumb is that if you only care what the code does, you should let the compiler figure it out. If you care how the compiler accomplishes that goal, you should specify that rather than hoping things don't silently break in the future. This is a fairly common thing in crypto and systems code.

But yes, fast inverse sqrt is obsolete.


Nowaways you just write 'divout = divin/8192' and assume the compiler is going to do the right thing (and very possibly do something deeper than "divin>>12" at the assembler level).

Makes me wonder who pays attention to this sort of thing these days :)


I do! When optimizing code that must run obscenely fast, I look at the assembly the compiler spits out to make sure that it can't be improved on, speed-wise.

Usually, it can't -- but sometimes...


> I’ve found significant code in c/c++ where bitwise operations are done for things like division etc by shifting a certain way.

Oh, yes. I used to do that sort of thing frequently because the time savings was significant enough. As you say, though, compilers have improved a great deal since then, so it's not generally needed anymore.

If stupid bit tricks like that aren't necessary, they shouldn't be used. They do bring a readability/mental load cost with them.


If x is signed and happens to be negative, x/16 will round one way, and x>>4 another. x/16 can still be implemented more performantly than a general division with unknown (or even known but non power of two) denominator, but it will be marginally slower than a plain shift. It depends on which semantics you desire.



This is just the decay of knowledge over time and laziness combined.

From a quick glance internally, the overwhelming majority of repos are using an antiquated build/packager that while it might have been useful a decade ago is a productivity killer today.

The newer build / package system used publicly is light years ahead and provides a boon in productivity.

Not really sure why so many services in MSFT still run .NetFramework when “just” migrating over can lead to sometimes order of magnitude increase runtime performance and decreased resource consumption.

I think one of the real reasons is internally, most of the leads aren’t aware of it. There should be more evangelizing of the .NET team across the different orgs


Would be interesting to see how far a J2EE app will take you on this!


J2EE? The latest version from J2EE is from 2003. It was called Java EE for some years and it is known as Jakarta EE. Almost everything has changed since 2003.

https://en.wikipedia.org/wiki/Jakarta_EE


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: