Not sure whether, under El Capitan, the same tab options and choices exist as in Mavericks or Yosemite, but try this (especially on the iMac):
Open Safari sufficient to get the normal Safari menu at the extreme top of screen. For that, you don't necessarily need to be displaying a webpage. Then click Safari Preferences > Advanced tab. Change the browser fontsize to 14 or less. ("Never use font sizes smaller than ..."). Quit Safari and then re-launch it. This, for an iMac, usually sorts out the freezing of Safari. It's not a full solution but has proved to be an effective workaround for quite a number of users. Can't guarantee it'll work in your case but is worth a try.
Of course, ensure that Javascript is enabled (Safari Preferences > Security tab > Web content: enable Javascript). BTW, at present does Safari only freeze at specific websites?
It goes without saying that if you're using any anti-malware on either of your Macs, or any Extensions, they may well be interfering with the proper operation of Safari. If that's the case then remove them before applying the fontsize workaround.