Websites with heavy use of websockets skyrocket CPU usage in Safari
As troubleshooting steps, I'd try the following:


Test with another browser to see what happens. If the problem isn't repeated then you're starting to isolate the issue, although I would then try a 3rd browser for good measure to see how it also behaves.
Boot into Safe Mode (see below) and test again with Safari


Boot into Safe Mode 

Follow these steps to boot your MBP into Safe Mode: 


Fully shut down your Mac 
Restart your Mac 
Immediately press the Shift key and keep it down 
Let go of the Shift key when you see the login window (NOTE: If you have FileVault enabled you may need to log in twice). 
Take a note of what happens (i.e. visit the sites again with Safari and try to replicate the problem) 
Exit Safe Mode by restarting your Mac as normal 
Test again when booted normally 


Let me know how these steps went and we'll go from there.