ETA: After dropping caches it took 18m40s to build Ubuntu mainline 6.16.3 with gcc-14 on my 5950X, with packages for everything including linux-doc, linux-rust-lib, linux-source, etc. I'd expect the same operation to take about 11m on a 9950X.
It's also not clear whether OP used Clang or GCC to build the kernel. Clang would be faster.
Even my dual 7402 with 96 threads and 512 GiB of RAM can't compile a maximal Linux config x86 build in RAM in under 3 minutes.
What I find helps repeated builds is maintaining a memcache server instance for sccache.
I’m probably thinking of various other packages, since at the time I was all-in on Gentoo. I distinctly remember trying to get distcc running to have the other computers (a Celeron 333 MHz and Pentium III 550 MHz) helping out for overnight builds.
Can’t say that I miss that, because I spent more time configuring, troubleshooting, and building than using, but it did teach me a fair amount about Linux in general, and that’s definitely been worth it.
rotational disks usually top up at ~85 MB/sec, with seek time being up to 12 msec for consumer drives and ~6 msec for enterprise drives (15k rpm).
ssd could saturate the sata bus and would top at 500-550 MB/sec, with essentially no seek time. latency wold be anything between 50 and 250 microseconds (depending on the operation).
nvme disks instead can sometimes full utilise a pci-e lane and reach multiple gigabytes/second in sequential read (ie: pci-e gen5 nvme disks can peak at 7 GB/sec) with latencies as low as 10–30 microseconds for reads and 20–100 microseconds for writes.
As compiling the kernel meant/means doing a lot of i/o on small files, you can see why disk access is a huge factor.
A friend of mine did work on LLVM for his PhD... The first thing he did when he got funding for his phd was getting a laptop with as much memory as possible (i think it was 64gb on a dell workstation, at the time) and mount his work directory in tmpfs.
Also disabling building the _dbg package for the Debian build will significantly speed things up. Building that package takes a strangely long amount of time.