How do I exclude ESP-IDF built-in libraries from assembly?

How do I exclude ESP-IDF built-in libraries from assembly?
When I compile, I see that everything in the ESP-IDF is compiled, including what I don’t need. For example, I am not using an HTTP server, but it compiles anyway. And a lot more.
I fully admit that all this does not end up in the final code, but why then, given the rather modest capabilities of the program, does it take up 87% of the available memory?

Link-time optimizations shoud still apply. You should be able to use the memory inspector as e.g. shown here to list all symbols in the resulting firmware, by size, to find out what’s compiled in there.

I think ESP-IDF works the same way, compile and link everything, apply link time optimization. It should yield the exact same results, given the same ESP-IDF and compiler version, since PlatformIO is just calling into ESP-IDF’s cmake build system.