Please try and turn off Windows 10 Game mode.
This can be done by going to your Windows Start button (lower left) and choose Settings.
Then choose Gaming
In the Game Bar section:
The setting "Record game clips, screen shots, and broadcast using Game bar" - change that to OFF.
Also uncheck "Open Game bar using this button on the controller" and
"Show Game bar when I play full screen games Microsoft has verified"
In the Game DVR section:
Scroll down to the Recorded Audio section
and turn "Record audio when I record a game" OFF
In the Game Mode section:
Make sure that "Use Game Mode" is OFF
In Oculus Rift, if possible, try and disable ASW (Asynchronous SpaceWarp).
In iRacing, lower the number of cars rendered. You can do this one of two ways:
Launch the sim (in a TEST session for example), click Options (at the top right before you get out onto the track), then click the Graphics tab (at the bottom), click the Advanced button (to show more options) and lower the Max Cars option on the lower left OR
Open to edit the app.ini file (located in your Documents/iRacing folder), scroll to the [Graphics] section and lower the value of serverTransmitMaxCars. Then save the file.
It may also be a bottle neck with the number of drawPrim() calls -- each one has an overhead, and the rendering submission to the GPU is single threaded in DirectX 11. Drawing fewer mirrors, shadows, and cars/pit objects can help reduce that count.