A few weeks ago, The Wall Street Journal reported on housing subsidies that some tech companies in California are providing to employees who live close to the office. “Companies such as Addepar and Facebook Inc. are offering rent subsidies, house-hunting services and down-payment help for employees willing to live close to the office,” writes Rachel Feintzeig. “The perk helps these companies attract workers who might balk at moving to high-rent areas, such as Silicon Valley and New York City. And, managers say, employees who live in the neighborhood often work late and stay with the company longer.”

The perk might also be making employees substantially happier.

People often choose to live far away from their offices in exchange for other benefits—a bigger house, a nice yard, better schools, etc. But the research increasingly indicates that the length and difficulty of a person’s commute may play a much bigger role in their happiness than the size of their house. A 2008 paper by Alois Stutzer and Bruno S. Frey in The Scandinavian Journal of Economics analyzed the subjective wellbeing of commuters in Germany. Stutzer and Frey find that commuters are much less happy than non-commuters, which suggests that whatever benefits they may derive from a longer commute are outweighed by the commute itself:

Our main result indicates, however, that people with long journeys to and from work are systematically worse off and report significantly lower subjective well-being.

It does, however, seem that it’s possible to mitigate the stress of commuting with alternative work arrangements. A 2002 paper in the Journal of Business and Psychology, by Jennifer L. Lucas and Ronald B. Heady, studied the effects of flextime working arrangements on driver stress, feelings of time urgency, and travel satisfaction among commuters in Atlanta—a city with particularly long commutes. The researchers found that commuters with flextime arrangements had lower levels of driver stress and time urgency, but similar levels of overall commute satisfaction.

“This study is important because it provides some evidence that flextime is beneficial for commuters,” write Lucas and Heady. “Flextime lowers driver stress levels and feelings of time urgency.” And lowering commuting stress may have a host of other benefits. Commuting stress is correlated with sleep quality, health, problems at work, and negative employee attitudes. The researchers conclude by suggesting that “employers should consider flextime if their goal is to enhance worker on-the-job performance via off-the-job factors.”

Flextime arrangements and housing subsidies of the type offered by some firms, then, really may make for happier, more productive employees.