It's not stupidity to "pay for performance" in education, it's rather how it is attempted to be done.
Teaching for grades. :-S Teaching for good performance in standardized tests. Pardon me.
You may have a strong class or a rather uninterested one etc. 15 - 30 kids are by no means statistically relevant.
There is only one solution: Hire really good testers (so to speak ;-) ) and evaluate teachers "everyday-performance".
I am absolutely sure you get very clear results. And I'm a teacher myself.
Given that it is possible to find enough good testers and someone to pay for them. How was this in software development already? :-)
If you evaluate this process for its side result, you will quite easily find the teachers should have been offered a suitable "retirement scheme" years ago. That is.
As you can see, sometimes side results are the most important thing..