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.)

This has occupied more of my evening than I probably ought to admit, and there has been some rather undignified giggling while my wife and I pondered what, exactly, could possibly cause the sudden manifestation of a cubic light-year of uniformly dense cheese.

Regardless, it certainly wouldn’t stay uniformly dense for long; that much is certainly clear from your calculations above!

I must comment, though — with as little pedantry as possible — that one simply does not swap spherical and cubic volumes. While a profound thought exercise, your cubic light-year of cheese would assume the form of a sphere without the outside influence of (we assume) the same divine power that curdled it into existence. The radius of this would be just over half a light-year, 5.869 x 10^15 meters.

This clearly does not affect the final outcome, as this glorious mass — though galacticly insignificant volume — of cheese would shortly collapse in upon itself, perhaps showering its nearby neighbors with a rain of fondue in the process.

…

Should it manifest as a Swiss cheese of the same mass, however, it should be noted that this Schwarzschild Radius is an astonishing 129,390,756 LIGHT YEARS, occupying a volume of 7.757 x 10^72 cubic meters — 9.16 x 10^24 cubic light-years.

Wow.

That’s a lot of cheese. (And here’s hoping XKCD notices this and runs with it.)

As to the Black Hole postulate, estimating the likelihood of collapse, and rate thereof, would depend upon what we can provisionally identify as the mode of manifestation of the cubic lightyear of cheese.

(Note: As will become clear, I am not an astrophysicist and don’t even play one on the internet.)

For example: Has it been constructed? Have smaller chunks of stable cheese been somehow brought together? Has a stable configuration or assemblage of pre-existing matter been instantaneously transformed into cheese?

Perhaps we need to posulate the existence of an arrangement, perhaps a kind of surrounding latticework, of dense material, superhard candy, perhaps, sufficient in mass to generate counter-gravity? How large would it have to be to prevent the Black Hole collapse?

Alternatively, if we supposed a god-like entity capable of wishing the cheese supermass into existence, then why should we assume that it lacks the ability to sustain it, at will – or, if subject to other physical laws of this universe, capable of exerting the same force provided by the above-referenced superhard candy counter-gravity latticework.