Why isn't "small" static code size the same as fast?

By: anon2 (anon.delete@this.anon.com), August 5, 2022 5:33 pm
Room: Moderated Discussions
anonymous2 (anonymous2.delete@this.example.com) on August 5, 2022 2:05 pm wrote:
> Sorry, not quite.
> Why isn't smaller (-Os) in effect fast (like -O3) from an ISA design/implementation?
> Are the differences we see today the result of ISA/silicon/compiler evolution over time?
> Or is there are fundamental reason why they can't be _mostly_ the same thing?
> Smaller code fits more cache, it's rarely slower than unoptimized code (embedded anecdote).

Firstly, dynamic cache footprint or cache misses is not the same as in-memory image size. Good cache optimization can increase code size for example by moving cold branches out of line, aligning hot branch targets. Secondly, the importance of small icache footprint for performance is greatly over stated by some. Not that it's unimportant, but it's not so big that all opposing concerns become negligible.
< Previous Post in Thread 
TopicPosted ByDate
ISA (x86/armv8) q: Why isn't "gcc -Os" ~ "gcc -O3" ? (NT)anonymous22022/08/05 10:11 AM
  Why isn't "small" static code size the same as fast?Mark Roulo2022/08/05 12:10 PM
    Why isn't "small" static code size the same as fast?anonymous22022/08/05 02:05 PM
      Two examplesMark Roulo2022/08/05 02:20 PM
      Why isn't "small" static code size the same as fast?Andrey2022/08/05 04:08 PM
      Why isn't "small" static code size the same as fast?anon22022/08/05 05:33 PM
Reply to this Topic
Body: No Text
How do you spell tangerine? ūüćä