I'd say it's 50/50. Whichever is closer/more convenient to your driving is probably the way to go. Every once in a while one has a deal that the other doesn't but generally not worth getting a membership for.
I went to Costco's, Sam's, and BJ's looking for an electronics item one day. All three had prices on identical equipment within pennies of each other. All three had some models the same and some different but the overall product range was comparable. I don't bother with groceries at the WH Clubs because the local market has prices VERY compareable (sometimes better, sometimes slightly worse--but never a huge difference) on a $/oz basis. There's much less waste going with smaller quantities at the local market... plus they BAG up your items and the lines are much quicker.
Costco's has these Killer rotissery chickens they cook in the store (some stores) now, for $4.99 they are a steal. People line up waiting for them to come out of the cooker and they sell out quick. They are about equal distance from Sam's, but due to the chickens they got my membership for another year.