Open Menu
AllLocalCommunitiesAbout
lotide
AllLocalCommunitiesAbout
Login

Hardware-Aware Coding: CPU Architecture Concepts Every Developer Should Know

⁨72⁩ ⁨likes⁩

Submitted ⁨⁨1⁩ ⁨month⁩ ago⁩ by ⁨abhi9u@lemmy.world⁩ to ⁨technology@lemmy.world⁩

https://blog.codingconfessions.com/p/hardware-aware-coding

source

Comments

Sort:hotnewtop
  • call_me_xale@lemmy.zip ⁨1⁩ ⁨month⁩ ago

    Can we just not with the AI-generated illustrations?

    source
  • pixeltree@lemmy.blahaj.zone ⁨1⁩ ⁨month⁩ ago

    TL:DR: minimize randomness, group variables by access frequency, and unroll loops if your compiler doesn’t do that already

    source
    • call_me_xale@lemmy.zip ⁨1⁩ ⁨month⁩ ago

      tl;dr tl;dr: use a modern compiler.

      source
    • bejean@lemmy.world ⁨1⁩ ⁨month⁩ ago

      Do any compilers NOT unroll loops in high optimization modes? I was under three impression this was usually unnecessary.

      source
      • pixeltree@lemmy.blahaj.zone ⁨1⁩ ⁨month⁩ ago

        No clue, I was just frustrated with how much useless extended metaphor was in the article and thought I’d save people some time

        source
      • InverseParallax@lemmy.world ⁨1⁩ ⁨month⁩ ago

        Really depends on the target, llvm goes between unrollimg and vectorizing cleanly, to unrollimg to a ludicrous degree, to refusing to unroll period.

        Some of it is subtarget specific, but sometimes it’s just weird.

        Gcc is evil incarnate, all it’s passes are at war with each other, loop Canon form often broke vectorization and even unrolling period.

        source
  • ElPussyKangaroo@lemmy.world ⁨1⁩ ⁨month⁩ ago

    What about Claude-Aware coding tho? /s

    source