Dooglus did this for JD after the old wallet became too large. It helped performance, but he had to manually credit users that deposited to addresses in the previous wallet, which is far from ideal.
I do not quite understand this. Does this mean that it is actually the wallet that keeps track of which customer has how much money, by keeping each customer's btc under a separate unique address? That seems quite a bit of a mess since if I get some money out then the change is by default sent back to a new change address and somehow the wallet has to know that it also belongs to me. So it is hard to maintain a one-to-one correspondence between addresses in the wallet and users. Or you can set it up to send the change back to the same address where the transaction came from?
Nah. user balances are typically stored in a database that is completely separate from the wallet. The wallet contains all the deposit address as well as all addresses used internally to use funds around. When a user generates a deposit address, it is added to that users account in the database and when deposits come in, the service queries its database to match the deposit address used to a username and updates the balance accordingly.
If you have thousands of users, many with possibly more than one deposit address generated, as well as addresses used for internal purposes and change addresses, the wallet can become huge and apparently this can slow things down considerably.