I used to have about 4 months of expenses in a savings account as a "rainy day fund" in case of emergencies.
The last year or so, though, I've switched to having a minimum of expenses (about 1 month's average expenses) in my savings account and moving everything else into investments. I keep my investments in a robo-advisor account, so when I make withdrawals the robo-advisor calculates the optimal shares to sell to minimize my tax burden. Withdrawals take less than a week, which suits my needs.
When I suddenly need cash, I just withdraw from the investments. Yes, I have to pay taxes on the withdrawal, and sometimes I catch a cycle where I need to withdraw money while my index fund values are down. However, both of these costs seem drastically outweighed by the financial benefits of having 3 months of expenses actually invested year-round rather than sitting in a savings account and not earning.
Am I misunderstanding the cost-benefit calculus here? All constructive criticism is very welcome!