serde, crossbeam, and rand all involve generics so you may be getting a decent amount more code than 4k lines after macro expansion (aka #[derive(Serialize, Hash)) and generic instantiation.
you might also be able to drop crossbeam for stdlib types and rand for much smaller random library if you don't need it's comprehensive features.
cargo's release profile also uses opt level 3 and thin-local lto by default. Whether you need those is up to you, hard to say more without knowing your project!
but yes it is somewhat easy to allow rust projects to creep up in compile times especially with how easy it is to bring in big useful libraries that often come with a lot of features. disabling features where possible is the go to if you have big dependencies.
you might also be able to drop crossbeam for stdlib types and rand for much smaller random library if you don't need it's comprehensive features.
cargo's release profile also uses opt level 3 and thin-local lto by default. Whether you need those is up to you, hard to say more without knowing your project!
but yes it is somewhat easy to allow rust projects to creep up in compile times especially with how easy it is to bring in big useful libraries that often come with a lot of features. disabling features where possible is the go to if you have big dependencies.
reply