Now, morale has sunk so low that some employees refer to Mayer, Yahoo's chief executive, as "Evita" - an allusion to Eva Peron, the former first lady of Argentina whose outsize ego and climb to power and wealth were chronicled in the musical of that name.
Mayer is about to make herself even less popular with Yahoo's nearly 11,000 employees. Faced with the failure of her efforts to reignite growth at the 22-year-old Silicon Valley company, she is now turning to the opposite strategy: cutting. As some investors press Yahoo to fire her, Mayer is crafting a last-ditch plan to streamline the company - including significant layoffs - that is expected to be announced before month's end.
While many Yahoo workers are keeping their heads down, just doing their jobs, others have lost faith in Mayer's leadership, according to conversations with more than 15 current and former employees from all levels of the company, most of whom spoke on the condition of anonymity because of continuing ties to Yahoo and its strict policy against leaks.
More than a third of the company's workforce has left in the last year, say people familiar with the data. Worried about the brain drain, Mayer has been approving hefty retention packages - in some cases, millions of dollars - to persuade people to reject job offers from other companies. But those bonuses have had the side effect of creating resentment among other Yahoo employees who have stayed loyal and not sought jobs elsewhere.
Only 34 percent of employees believe that Yahoo's prospects are improving, according to surveys conducted by Glassdoor, a firm that collects data on jobs and employers. That compares with 61 percent who are optimistic at Twitter, another troubled tech company, and 77 percent who see a bright future at Google, Mayer's former employer.
"Basically, it shows employees losing faith in Marissa Mayer and Yahoo," said Scott Dobroski, a spokesman for Glassdoor who analyzed the data.
Yahoo declined to comment on employee morale but said that turnover is normal at Silicon Valley companies. While thousands of people have left, many others have been hired, offsetting some of the losses. "We're still hiring, and our application numbers are strong," Yahoo said in a statement.
One Yahoo employee who was interviewed said she was praying to be laid off so she could collect a severance payment and move on with her life. Others said they were actively looking for their next jobs - a task made more difficult because of the taint of failure that potential employers sometimes associate with anyone at the struggling company.
"Brands are important out here for employers," said Nick Parham, a career coach in San Francisco who has had several Yahoo clients. "They are going to look harder at people from Facebook and Salesforce, companies that have winning strategies."
Employees' faith in Mayer began crumbling in earnest in August 2014, when Yahoo embarked on a series of stealth layoffs, current and former insiders said. For months, managers called in a handful of employees each week and fired them. No one knew who would be next, and the constant fear paralyzed the company, according to people who watched the process.
Last March, Mayer told the staff at an all-hands meeting that the bloodletting was finally over. Shortly thereafter, she changed her mind and demanded more cuts. All told, about 1,100 people lost their jobs in the layoffs.
Contributing to the employees' disenchantment were Mayer's protracted deliberations over a corporate reorganization last year that led to the departure of several key lieutenants and broke up the much-ballyhooed mobile team, prompting many mobile engineers to seek other jobs.
Hanging over everything has been the uncertainty about the company's plan to spin off its $26 billion stake in Alibaba, which was announced a year ago but was abandoned last month by the company's board of directors because of tax concerns.
For all of Yahoo's problems, many of its employees still have a deep affection for the company, whose products were the gateway to the Internet for a generation of web users and still remain popular, with more than 1 billion monthly visitors.
"We all want to make as much impact as we can and leverage Yahoo's existing strengths," said Austin Shoemaker, who now manages Yahoo's instant-messaging efforts after his startup, Cooliris, was acquired by Yahoo in 2014.
The company has long struggled to overcome two big challenges: the industrywide drop in display advertising that has traditionally been its primary revenue source and the distraction inherent in trying to excel at many different things, from news and fantasy sports to web searches and email.
Jeff Bonforte, Yahoo's senior vice president for communications products, said Mayer had always told people that it would take three to five years for the company's turnaround efforts to show results.
"It would be nice to give Yahoo one thing to magically save the company overnight," Bonforte said in an interview last month, adding that the idea was unrealistic. Mayer has invested in technology, he said, "to give Yahoo a chance to be incredibly integral to this next phase of where the Internet is going."
Bonforte's team, for example, has spent much of the last two years rebuilding Yahoo's email and instant-messaging services from the ground up, focusing on features such as better searches in email and the ability to unsend or delete an instant message at any time. While those reworked products garnered a modest reception from users, he said the technology was now in place for faster innovation.
He said Mayer was the best boss he had ever had, but acknowledged some truth in the common criticism that she was tightfisted with praise and sometimes displayed a harshness that could be demoralizing.
"Marissa is the type of boss that makes you feel like you're disappointing her at all times, so I always feel like I'm on the verge of being fired," said Bonforte, who is widely respected for both his talent and his irreverence. "It's never, 'Way to go, Jeff!' "
Bonforte said he was proud of Yahoo and his team and had no plans to leave. But other top executives have recently departed for other opportunities, including Kathy Savitt, the architect of the video strategy that Mayer has now dropped, and Jackie Reses, who led the company's acquisitions and managed its relationship with Alibaba, the Chinese e-commerce company in which Yahoo holds a 15 percent stake.
The latest loss was Prashant Fuloria, whose company, Flurry, was sold to Yahoo in 2014. Mayer put him in charge of Yahoo's critical advertising technology last January, but he quit in December to work on startup ideas.
Mayer has put on a brave face despite all the turmoil.
At Yahoo's annual holiday party, a Roaring Twenties-themed affair held Dec. 4 at Pier 48 in San Francisco, she sat in a chair - visibly pregnant with twin daughters who were born the next week - and posed for photos with employees. "She was kind of like Santa Claus," said one fan who waited in line for a picture.
Just before the party, Mayer and the company's other directors decided to stop pursuing the original Alibaba spinoff plan and instead slim down and spin off Yahoo's core business.
Now, everyone is waiting for details of that plan, which Mayer has promised to outline by the time the company reports its fourth-quarter financial results this month.
That is unlikely to soothe the unrest at Yahoo, however, since activist investors like the Starboard Value hedge fund are pushing for new management, a new board and a new strategy, including a possible sale of Yahoo's operating businesses.
Bonforte said those outside forces were beyond his control.
"That's the problem with a turnaround," he said. "The world gets to decide, 'Time's up.' "