According to Wolfram Alpha, there are 2.9 x 10^6 dietary calories in a cubic meter of cheese, 142829% of your recommended daily caloric intake.
Furthermore, there are 8.468×10^47 cubic meters in a cubic light year. From this, we can conclude that there are 2.455 x 10^54 dietary calories in a cubic light year of cheese.
According to NASA the sun produces 3.8 x 10^33 ergs/sec or roughly 3.8 x 10^26 joules/sec. Over the course of a year that adds up to approximately 6.065 x 10^37 joules of energy.
One dietary calorie or “kilocalorie” equals about 4180 joules. Doing the math we conclude it will take 1.7 x 10^20 years for our sun to generate the same amount of energy as a cubic light year of cheese.
Be warned, however, that at 977 kilograms per cubic meter, or 8.27 × 10^50 kilograms per cubic light year, the Schwarzchild Radius of a cubic light year of cheese would be 1.23 × 10^24 meters, significantly greater than the 9.46 x 10^15 meters in a light year. From this we can conclude that a cubic light year of cheese, should that somehow manifest itself, will immediately collapse into a black hole.
So while you would think a cubic light year of cheese would be the obvious choice over the sun, if you are presented with a choice between them, the numbers suggest you would be far better off choosing the sun.
These numbers assume cheese of approximately constant density. Swiss cheeses require much more sophisticated modelling.
(This article has been updated to reflect a comment from Jin, seen below, who notes that Wolfram returns dietary calorie units, which is to say kilocalories, rather than simply calories. The original claim, that it would take the sun 1.7 x 10^17 years to generate the same amount of energy as is contained in a cubic light-year of cheese was inaccurate, and has been corrected above. The author sincerely regrets any inconvenience this may have caused.)