I've just started teaching 9th grade Earth science and my students and I have noticed something about P and S wave depth vs velocity graphs. In the typical graph, eg: https://www.researchgate.net/figure/Earths-P-wave-velocity-S-wave-velocity-and-density-profiles-as-a-function-of-depth_fig8_280835886
With the p wave's velocity plotted from a depth of 0 km to a depth of 6371 km it shows the p wave velocity reaching about 14 km/sec by the time it reaches the bottom of the mantle. Then of course it drops precipitously through the mantle/outer core boundary. However, even when the wave reaches the inner core, it's velocity never gets close to that 14 km/sec speed, it's speeds in the inner/outer core range only from 8 to 12 km/sec even though the core has a much higher density than the mantle. You would expect a much higher wave velocity.