How much time do you have? When is this trip?
Do you want to see any Coastal Redwoods, or do you need to drive to Redwood National & State Parks?
MAP of both types of Big Trees: statusgo.us/wp-content/uploads/2014/05/Sequo…
I don't think either direction is absolutely 'better' than the other. You may want to cross the Sierra Nevada mountain range in Yosemite, and thus you'd want to do the loop in the direction that has lodging availability. Or you may want to avoid a huge convention in San Francisco. Or you may decide to save Las Vegas for a future trip and just explore more of California now.
I don't think that 5 days is sufficient for Las Vegas + driving to Yosemite + Yosemite + created-for-tourists drive thru trees + San Francisco + driving back to your home. That's more like a 10-12 day fast paced trip.
If your priority is Coastal Redwoods + a drive thru tree, then save all the rest for a future trip.