diesels vs gasoline engines?

At most throttle settings, yes. At wide open throttle they are about the same.

about the same=======yes

On my 25 year old 3 speed automatic 4x4 3/4 ton diesel truck:
If I keep it under peak torque, I get excellent fuel economy-@20MPG---unfortunately peak torque in my truck with it's rear end happens just under 60 mph. When I exceed peak torque, the fuel economy gets worse fast.
So. when I'm being frugal, I'm that old guy in the right hand lane that everybody is passing...........(not at all like my younger self). If I had to do it over again, I'd have ordered a high speed rear end.
I've been holding on to that truck for 25 years hoping to replace it with a diesel electric truck with the motors in the wheels-----------------(sigh)----I've begun to think that that ain't gonna be an option.
In the past 3 years, I've gotten to know some local mechanics...(not bad for a recluse)
Diesel has more energy than gasoline, so it provides better torque at lower rpm's, hence does not use as much fuel; more efficient. If you're getting poor mileage, that usually means your diesel engine is wearing out, is an older design, or both.

I have a recent JD 323e skid steer and can rip around at full throttle or move slow at idle and it still gets about that same amount of work done vs. on-board fuel.