Very similar to your stock investment, you track the value at the begining of the quarter, the cash you invested in this quarter, and the value at the end of the quarter. Then you calculate the annual growth rate the same way as you did for the stock investment.
You will find that, excluding your company match (if there is one), your annual growth on your retirement account should be less than your stock investment, because you are taking less risk here. However, if it is below 5%, you should seriously complain to the management company that manage your retirement accounts.
Now it is the decision point about the allocation of stock account vs. your retirement account. Maybe you would find that, with company match, you can make much better return on your retirement account. If you, you should allocate more into that. Do your math, and figure out which one is better for you.