Yes, that's right. What you want to do is maximize your sharpe ratio. You can play around with this python package to get a sense for how it works:
https://github.com/robertmartin8/PyPortfolioOpt
What you should be trying to achieve is a portfolio that earns the exact same return every single year, and you can do that in part by looking at historical covariance of the asset's time series. However, you also want to take a prospective view, and think about which asset classes may become correlated in the future.
There's no universal answer here (in the out of sample case - you can solve it in-sample), however. And another huge, huge factor is tax. Making sure your investments are tax-efficient is extremely important. Nothing will do more to ruin your compounding than taxes. So whatever you do, carefully consider the tax implications of your choices.
A lot of people focus on the tax rate. But what's actually quite a bit more important is the tax frequency. If you pay long term capital gains every two years on your whole portfolio...that's much worse than paying short term capital gains once at the very end (over a long period). What this means is that you want to choose things like passive ETFs, that are not taxed on their internal rebalancing. Even if you were to find a mutual fund that beat that ETF by 1% every year, the tax consequences of that fund would likely make it not worthwhile, before even considering the high fees it would likely charge you.