> As the PM on Google Maps, he was frustrated that the JavaScript was really slow. [...] So, one weekend he said, “I'm going to rewrite it”. And he rewrote the entire thing, making it 10 times as fast and a third of the size. He completely threw away the code that a team of engineers had been working on for months.
Maybe it wasn't as bad as that sounds, but the situation was something like the very ordinary... A team of engineers had been working on a lot of aspects, and optimizing was intentionally put off. Maybe there were also some suboptimal coordination or project management going on, which was hurting the team's effectiveness (which is something a product manager would speak about with the project manager or tech lead). Maybe he did it quietly, as a proof of concept, to confirm his intuition that the team was having problems, and as "data" to quietly show team leader that something is wrong. Or maybe he had a prior OK/encouragement from the team to rewrite the code they'd working on.
Alternatively, maybe it was as bad as it sounds -- a PM From Hell, pulling a move that engineers would be WTFing about for years -- but his "incredible" skillset included also being an incredible politician, so team morale wasn't destroyed.