During the JVM bootstrap we go through StubGenerator::generate_all() to generate a number of specialized routines. Many are used by interpreter and compiled code alike. As we add more such specialized routines, we incur a bootstrap cost, as evidenced by JDK-8270323
During C2 initialization, we also spend ~10 ms in a single thread generating stubs, most of which are not used early on. This happens in OptoRuntime::generate, generating 14 different stubs. By making this initialization happen on-demand, we would see less CPU spent early on things that might not be used, and we could see useful C2 compilations happen sooner, both of which could be beneficial to startup time.
Both cases could benefit from a lazy initialization scheme where uninitialized stubs are generated on demand.