The largest culprit for slow ruby boot times is an O(n) number of syscalls over the LOAD_PATH each time `require` is called, so the number of syscalls is essentially O(n*2) to the number of gems. The load-path-caching feature of bootsnap (cf. bootscale) fixes this, and accounts for a reduction from 25 to ~9.5 seconds. The iseq/yaml caching only accounts for the last ~3.5 seconds.
Aaron Patterson did a really great talk detailing the process called "Code Is Required". He's a really great presenter both humour wise and manages to often explain relatively technical things very understandably. Highly recommend watching this (and his other stuff)