Photo: SuperStock/Getty Images

Weeks like this, when walking outside feels like swimming through a wall of hot smells and airborne sweat, present a mystery for the 21st-century mind: How, in the days of yore — before refrigeration, before electric fans, before air-conditioning — did people make it through summer in New York?

The short answer is: A lot of them didn’t. Nearly 1,500 New Yorkers died during a heat wave in 1896, and nearly 700 fell victim to another one in 1901. Hot stretches are still a health hazard, particularly for the elderly and residents of poorer neighborhoods — there were roughly 600 heat deaths in the city each year between 2000 and 2006, and experts predict climate change will cause that number to soar in the coming decades — but the conveniences of modern life mean they’re not as dangerous as they used to be. Air conditioners became fixtures in public spaces in the 1930s and spread to private homes throughout the middle part of the 20th century. The risk of heat death has steadily dropped in conjunction with AC’s rise.

But as Stan Cox, author of Losing Our Cool, explained yesterday in a lecture at the New York Academy of Medicine, the lack of AC also gave our recent ancestors an advantage over our sweaty, miserable selves: Paradoxically, it made it easier for them to tolerate the heat. On a literal level, our reliance on air-conditioning is actually making the world hotter; residential cooling uses such a massive amount of energy, that AC use has climate researchers worried. But on a psychological level, it’s also making the air outside feel hotter: Like a caffeine addict guzzling his coffee, the more air-conditioning you have, the more you need it to feel good.

Scientists call this the “adaptive comfort model”: the idea that our ideal temperature depends in part on whatever temperature we’ve recently been exposed to. “If we experience more warmth, we can tolerate more warmth,” Cox said. “So if it’s 70 degrees outside, we may be most comfortable in the 70s. But by the time it’s 90 degrees outside, we may be as comfortable in the 80s.” He recalled an answer he’d read once on a survey about AC use: “We don’t use the air-conditioning because it makes it too hot outside.”

Which brings us to a strange and uncomfortable solution: To feel slightly less miserable in this heat, it may help to try sweating a little more while indoors. Or at least while you’re at home, anyway — good luck getting your office to ease up on the AC.