Pretty much every high performance car have gasoline engine. I mean there are diesel operated race cars but usually they compete in separate categories. So why isn’t diesel competitive against petrol?
I think you mean to ask “why Otto cycle”? Many classes of racer do not burn gasoline. Indy 500 cars, for instance, use ethanol (they switched from methanol a few years back).
Diesel fuel is injected close to top dead center on the compression cycle unlike gasoline that is drawn in during most of the intake stroke. Diesel also packs quite a punch when it burns. Therefore compared to a gasoline engine, a diesel engine has to be built stronger (therefore heavier) and can’t rev very high as there’s a limited time that the diesel fuel can be injected into the combustion chamber.
Power density. Otto-cycle engines have greater horsepower per pound of weight than diesels. If acceleration is the increase of kinetic energy per unit time, then the faster you can deliver energy, i.e. the greater the power, the more acceleration you will have.
You could put a much heavier diesel engine in to produce the same power as a smaller otto-cycle engine, but then you’d be compromising maneuverability and the ability to add ballast to position the car’s center of mass at the optimal position. Moreover, you’d have to make the engine even more powerful to compensate for the now-larger weight of the vehicle.
Diesels have competed successfully in endurance races, but Audi said the engine’s weight made it a real challenge. Fuel economy has a lot to do with why this diesel-engined car was competitive against Otto-cycle engined vehicles in this venue. Unless the rules change drastically, I doubt you’ll ever see a diesel competing in F1 races, which typically only last an hour or two.