There are lots of difference in terms of performance, costs, manufacturing, injection pressure, etc when we go for petrol engine vs diesel engine comparison. I will make as short list down below.

Petrol engine vs diesel engine Construction

Compression Ratio – Diesel engines have a compression ratio from 16 to 19 (gasoline can’t have such a big c.r. because gasoline would auto-ignite = engine knocking)

Injection Pressure – Modern Diesel engines use common rail technology – pressure goes up to 2200 bar. In gasoline engines, injection pressure does not exceed 200 bar.

Diesel has a lean mixture (more air than fuel)

Diesel fuel auto-ignites, gasoline mixes with air and the mixture is lit by a spark plug

Exhaust gases in gasoline engines reach 900 degrees C, while in Diesel engines 350 degrees C.

A Diesel engine is heavier than a gasoline engine (much stronger alloy and heavier alloy to support those enormous pressures)

Modern Diesel engines have DPFs which are good for the environment, but a pain for the driver (loss of power).

Petrol engine vs diesel engine Performance

Diesel engines have a thermal efficiency from 40 to 45% while petrol engine from 25 to 30%.

Diesel engines have more torque – having a high compression ratio + a turbocharger = more torque. Generally, a Diesel and a Gasoline engine with the same displacements, with the same power output have will have different torque outputs – the Diesel engine will have more.

Diesel engines have more turbo lag than gasoline engines (some gasoline engines are naturally aspirated and don’t have lag at all)

Diesel engines are great for pulling and running at lower speeds, gasoline engines are great for driving at higher speeds (there’s no Diesel production car to exceed 300 km/h).

Petrol engine vs diesel engine Costs

A brand new car with a Diesel engine is more expensive (from $2000 to $6000)

Maintenance costs are higher (injectors, turbochargers, clutches kits, oil/fuel filters – all are more expensive)