You can have mitral valve prolapse and a doctor cannot hear the characteristic click or murmur.
The longer the stress continues, the greater the risk.
Hip surgery will cause pain and there might be some blood loss. These are all short-term risks. Having pain in the hip and not being able to move well are risks as well that may have more overall risk over time.
If you are not having active symptoms of heart disease, the surgery might lower risk over the long haul if there are no complications.
You will have less pain, exercise more, keep the weight off, sleep better, and feel happier. These factors in my opinion would help your heart risk long term. Nothing is risk free. Obtain opinions of others, pray, and be well informed.
I hope this answer helps.
My prayers are with you.