One, careful with your inventory. If you carry too much different item, like twenty suits of leather armors of various durability degree, and stuffs, it could lead to slowdown in loading bartering screen. Most notably is after you looting a vault and has the capacity to carry them all, then visit a major merchant. One stack is better than several separate items.
two, dont buy too many item of different category. Buy twenty guns, or ten guns then amors, is fine. but if you spread to three categories it lead to dangerous crashable stituation.Best to buy all guns in one go, then armor, then aids, then misc, then ammo.
Three, some certain items could lead to crash, like hullbox, jar of powder, case of casings. For such items, buy one group, like 3 jar of small rifle powder, at once, before other. Because when you get it to your inventory it change into different items, so buying too many will lead to freeze.
Generally, rule of thumb about crashing in barter window has two criteria: the number of item stack on both your and trader inventory, and the number of item transforming when you trade.