There are so many variables to this question there is no right answer.
I boarded a ship in Boston and was so early that I walked right on and had to wait hours before my cabin was available. It was a small ship and the only one in port.
The Florida ports are massive and host many ships on any given day, but they are so adept at it that they make it seem effortless..in the interest of full disclosure, I've only sailed from Ft. Lauderdale, not Miami.
The weather can also be a factor, sometimes fog can delay ships getting in as well as flight delays.
The bottom line is what works best for you. If you're staying at a local hotel, I'd stay and relax until check-out and just plan on an hour to get into the terminal and board the ship. Often the vehicle traffic going in is the worst part. If you're taking a shuttle, have your camera ready, you'll have gorgeous panoramic views of many ships.
Remember that any carry-ons you bring will have to be carried around. You usually can't get to your cabin until 1:30 or 2, so bring what you need but travel light.
The fewer things you carry aboard, the easier the screening process. The lines tend to move fairly quickly and remember, every one is on vacation, unlike the airport, so the mood is more upbeat.
And finally, be smart. Have your documentation in order. Have your tickets available, have your passport out. And don't try to smuggle alcohol or other items on against policy. They will catch you and your vacation will start on a sour note.