Why is the Radix Wallet and Radix Explorer slow?

Some of you may have noticed Network Gateway queries being slow recently - resulting in slowness or errors in the Wallet and Explorer. This can be noticed especially in the History tab.
This is a different issue from the old, archive nodes issue, since Radix DLT switched to a new system using a single Network Gateway.

According to the team, the problem is caused by…

Slowness when loading account transaction streams, particularly those containing airdrops with large transactions.

Source: David (Radix), on Telegram.

A more technical and thorough explanation about the issue is provided by @Mleekko:

The biggest performance issue is that when you open the History tab, for every transaction, the Wallet parses all addresses involved, validates them, and then converts to the Public Keys. Which is a complete waste of resources, as you don’t need PKs for any address until you try to send a transaction (or decrypt an incoming message).
The second biggest issue is that while the History tab remains open, the parsing is done repeatedly for the same transactions every 15 seconds, when the latest transactions are fetched from the server.
Lastly, all the amounts in the transactions are converted from attos to a properly formatted money string, even if the amounts are not displayed (and again repeated every 15 seconds).

Sadly, as of right now, this issue isn’t a top priority for the team, since the whole Desktop Wallet will be replaced in the future:

…the current wallet will be completely obsoleted and replaced by an entirely fresh wallet for Babylon. This current wallet is basic and clunky. We know. It was done to get something out for Olympia and was always meant to be temporary. It’s not worth us tuning it up for the Olympia network; we’d rather focus on the Babylon wallet which really will be a very dramatic departure. See the blog post I mentioned above.

Source: Matt (RDX Works), on Telegram.

This problem also affects the Radix Explorer:

…since it uses the same radixdlt-javascript library, which is designed to parse all data fetched from the API eagerly, which is good for something that processes and reacts to transactions, but not for a simple wallet.

Broken transactions/accounts examples:

Many thanks to @Mleekko for providing the technical explanations and examples.