I have never experienced any pet that needed surgery, but this is a heart-wrenching decision to make, to say the least.
I have always surrounded myself with dogs up until about 15 years ago when our Shi Tzu passed. It was just so painful for myself and the better half that I haven't had the nerve to own another.
I still love animals, it's just I don't want to be subjected to that pain again.
It comes down to a personal decision on your part, and only you know what that threshold is.