I don’t find it so strange that the iPhone 8 would be faster than the X (of course, we still don’t have shipped iPhone X models in-hand) - but with all the extra load on the hardware - extra cameras, extra screen (with some unique screen geometry to deal with with the “horns” and all), assuming the exact same processor in the phones, it just seems logical the 8 would test out at least some faster.
What is surprising is that Apple didn’t tweak the clock on the iPhone X enough to prevent the difference.
The faster you tweak the processor, the less time the battery will last. The other reason it will be slower is that the memory required to even display the screen is greater. That takes time.