San Francisco is very different from the rest of the US, particularly in the quality and cost of food.
So, the cost comparison may be apt although this page, which compare cost of living between San Francisco and Denmark suggests that groceries in San Francisco are way more expensive (nearly 60%), although restaurants are cheaper (16%).
https://www.numbeo.com/cost-of-living/compare_cities.jsp?cou...
Not sure how reliable a source this is though.