I have use a small lab size ultrasonic cleaner at times to clean bolt groups and MAC 10s (why a MAC 10 needed to be that clean is another discussion ;-), however, I typically use one of two version of a "dunk" tank or "parts washer" , unless just using the "Whore Bath" like NE450No2 covered nicely, with better language than I ever could ;-).
The shop has the standard 20 gallon parts washer filled with a 140F+ flash point (
Flash point - Wikipedia) parts washer fluid that is solvent based, not water based (this fluid is really highly refined mineral spirits that has the lighter factions removed to raise the flash point from 104F of mineral spirits to over 140F). A 20 gallon parts washer is $99 at Harbor Freight but the pumps are typically only rated for water based solvents and don't last long with the mineral spirit type solvents. While a lot of people have, would recommend not use odorless mineral spirits (flash point 104F to 120F depending on type) inside a closed space due to the risk of fire from vapor build up. Menard's in Indiana has been carrying the solvent based parts washer fluid, along with some auto parts stores (not the major chains though).
The portable "cleaning" tank to use way from the shop or when at home, is a tray from Lowels, made to mix mortar in, to which I ad a gallon two of high vapor pressure parts washing solvent from gallon paint cans (which work fine just as is for cleaning smaller internal parts) and brush until nominally clean. I then have a pint bottle with a spout to flood/rinse the bore and chamber with. Blow or drip dry as need and then lube with Break Free. Note have used a few percent Break Free or ATF in the solvent to help clean and leave an oily film. A few photos at
Gun Cleaning
Cleaning Pan w/o Solvent Added
Cleaning Pan and Drain Rack
Cleaned Parts with Break Free Draining Off (Excess Break Free can be added to the solvent)