Engine braking for gas engines always comes from intake stroke, working against vacuum of a closed throttle. What you get is proportional to displacement and engine RPM. The 6.8 engine on my motorhome gives me a lot more braking power at 3500-5000 RPM than the 1.5 in my car at any RPM (I can safely run it up to 5000-6000), even though it has a manual transmission. But there is a lot less car to slow down.
For diesels, there are at least two approaches. Lowest cost is to throttle the exhaust, thus "exhaust brake." Yes, higher compression gives more braking on the exhaust stroke than you would get on the intake from a gasser, but there are few diesels you can crank to 5000 RPM for braking, so might be sort of a wash. And of course, displacement and vehicle mass matter.
Since most diesels today are turbocharged, there is already some back pressure in the turbine, for exhaust braking. Some recent variable vane turbo designs adjust vane angle to increase flow resistance, which is almost as effective as throttling the exhaust.
Then there is the compression release brake, which opens the exhaust valve at the top of the compression stroke (Jake brake) which can offer somewhat more abrupt braking than exhaust brake designs, but this has to be designed into the engine. As a trucker, this is probably what your were using.
Same size engine, a gas engine with throttle closed at 5000 RPM will probably provide more braking than a diesel with exhaust valve closed at 1200 RPM, but not many operators have the nerve to do that to their gas engines, more typically gear for 2000-3000 RPM where there is a lot less braking power.