top | item 34423997

(no title)

martin_ky | 3 years ago

It seems to be a pattern with (not just) Microsoft products to hang the UI while waiting for some remote API, usually talking to the home base. Happens a lot to me with Office desktop apps - they freeze sometimes for a good second or so while starting and more surprisingly also when closing. One time it bothered me so much, that I recorded an ETW and unsurprisingly the time during the hang was spent waiting for some http request. I noticed that often the online version of these apps (namely Outlook) are more responsive than the desktop counterparts.

Edit: My experience with Excel - https://twitter.com/martin_ky/status/983019737729916930?s=20

discuss

order

iforgotpassword|3 years ago

I guess it's because in web context, it's easier to do web calls async than sync. While it's perfectly possible to do async web calls in something like C++, or at least move stuff to a different thread, people just somehow don't. Maybe out of lazyness since the first Google result was sync, or because lifecycle management is harder if raw pointers are involved, or whatever else.

kaptainscarlet|3 years ago

I'm guilty of this. Back when I was writing Java apps using Swing, I'd perform heavy blocking IO operations in button event handlers synchronously. Looking back, I realise how much haram I was committing.

fluoridation|3 years ago

It's because the default program structure in C and C++ makes functions blocking, with the caller assuming that if the callee returned it completed. Jamming a non-blocking program structure smack in the middle of a blocking system is never pretty, and most people prefer not to deal with the additional complexity. For the same reason, even though Windows has overlapped IO and other asynchronous IO mechanisms, most people prefer to use the synchronous functions.

acdha|3 years ago

In some cases I wonder if the Office team had internal coding policies against threading because they aren’t sure about thread safety on some legacy structures. I remember reporting the issues Outlook had blocking UI waiting on network calls in the Office 97 beta (oh, was I an optimistic teenager) and multiple decades later that’s still affecting users.

rightbyte|3 years ago

I use Win10 at work and the Calc app lags for like 10s when opening before I can type in it. I firmly remember it started to do that after some reboot update ...

0cf8612b2e1e|3 years ago

The new calc app has always been a travesty. Taking at least a full second or more to load, with an obnoxiously large interface. The original calculator opened instantly and had a completely functional ui. I get angry every time I need to launch calculator on a machine I have not configured with SpeedCrunch. Almost better to use Excel.

tupac_speedrap|3 years ago

I hate the slow right click menu too, why is there a forced delay?

I think visual design peaked a few years ago and now we are deliberately overcomplicating every piece of UI for no apparent reason.

grishka|3 years ago

I wonder how much improvement can be had by installing an application firewall and restricting everything that doesn't need networking for its primary functionality.

roel_v|3 years ago

Not much. A lot of this sort of functionality is offloaded onto opaquely named services. So now you have decide if some access should or should not be allowed; but with very little information as to what process will in the end use that access. I used Glasswire for a long time, and when you install it on a new machine you get a lot of allow/block notifications; but then if you go back and look at the 'rule set' that was build up that way some months later, it's really hard to see what was blocked for what reason and if you actually should be blocking it.

One example is embedded IE/Edge views. It seems that those are a process of its own (sometimes), likely out-of-process COM instances. But if you want to allow one program to access the network that way but not another one, well there is (to my knowledge, and I haven't really looked into this) no way to do that. Same for the 'background download' service, the search service mentioned in the OP (although that's only used internally by Windows afaik, but by several sub-components), etc.

Not to mention, there isn't a whole lot of software left that doesn't need at least some networking for its 'primary' functionality. Whether that's by design I don't know. I blame engineers and marketing/product people equally for not showing enough restraint (i.e. the trope of 'just because they could... asked if they should...' etc). But nobody cares about my opinion on this, and the majority of users don't realize or care - and even if they do, they're as powerless as I am, individually.

vladvasiliu|3 years ago

Wouldn't that make things worse? Those applications usually expect to be able to make these calls. So now, instead of lagging once in a while when the home base is having troubles, it will lag all the time.

kevincox|3 years ago

This is actually one of the things that I appreciate from React. Because the view is synchronous you need to explicitly bail out on loading states (`return <ProgressSpinner/>`). In general you are presented the option to do something while the async work is running and other parts of the UI almost always work.

albrewer|3 years ago

The option exists in C# / WPF, too, so not handling it and just blocking the main thread is bad programming.

samplatt|3 years ago

General question for the class... Is there any way to stop this? Is there some entries we can add to the hosts file so that Windows and Office will instantly return as failed, rather than timing out?

A4ET8a8uTh0|3 years ago

Hosts file would be your first way assuming you trust MS to honor that convention. You can always consider using a way that is not reliant on Windows goodwill ( for example, Pihole would allow you to limit various unwanted IPs based on your custom list; technically, your router should be able to do it too, but it varies wildly by mfctr/model ). That said, I am not that familiar with that functionality in Excel and it is not a given that it would fail gracefully if it is actually stopped from calling mothership.

EVa5I7bHFq9mnYK|3 years ago

I use W10Privacy. It blocks all MS servers except those needed to get updates and antivirus definitions.

iforgotpassword|3 years ago

If you want to put in the effort you can sniff the hostname lookups and if it's done halfway dedicated name, as an entry for 0.0.0.0 to the hosts file.

barbazoo|3 years ago

That exchange with the Microsoft support account is just such a facepalm.

type-r|3 years ago

happens a bunch on mobile for me too. if I'm on unreliable wifi / cellular, it's easier to go into airplane mode than wait for Spotify to try to complete a remote call when searching my library