It seems logical to me that on a 64-bit kernel compiling it to optimize for size might help overall. (My distro of choice uses -O2) It has the benefits of more registers and memory and perhaps less cache contention than normal optimized code. I have a kernel compiled like this and it seems excellent. However my question is how can I prove this? I like using Phoronix for "real world" sort of benchmarks so I would prefer to test cases like that. What should I pick to test? Does anyone else have any alternatives? Thank you very much in advance.
If your -Os compiled kernel "seems excellent" I think you shouldn't care benchmarking it, here is why:
The problem with benchmarks will always be to choose what types of loads you test.
In case you still want to try this:
I personally highly doubt you'll see any real (measurable, repeatable) speedup with -Os on a modern desktop CPU (embedded CPU can gain some performances though). The little more aggressive optimizations with -O2 (source article) might be more interesting than the smallest size of the -Os kernel.
If you need more infos/wants to talk about gcc optimizations more thoroughly you can go on the #gentoo channel on freenode IRC or on the gentoo forums, but remember: just don't mention the term "ricer" ^^