chrs@programming.dev to Rust@programming.devEnglish · 7 months ago"Clean" Code, Horrible Performance in Rustchrs.devexternal-linkmessage-square3fedilinkarrow-up12arrow-down10
arrow-up12arrow-down1external-link"Clean" Code, Horrible Performance in Rustchrs.devchrs@programming.dev to Rust@programming.devEnglish · 7 months agomessage-square3fedilink
minus-squaregedhrel@lemmy.worldlinkfedilinkarrow-up1·7 months agoCasey’s video is interesting, but his example is framed as moving from 35 cycles/object to 24 cycles/object being a 1.5x speedup. Another way to look at this is, it’s a 12-cycle speedup per object. If you’re writing a shader or a physics sim this is a massive difference. If you’re building typical business software, it isn’t; that 10,000-line monster method does crop up, and it’s a maintenance disaster. I think extracting “clean code principles lead to a 50% cost increase” is a message that needs taking with a degree of context.
Casey’s video is interesting, but his example is framed as moving from 35 cycles/object to 24 cycles/object being a 1.5x speedup.
Another way to look at this is, it’s a 12-cycle speedup per object.
If you’re writing a shader or a physics sim this is a massive difference.
If you’re building typical business software, it isn’t; that 10,000-line monster method does crop up, and it’s a maintenance disaster.
I think extracting “clean code principles lead to a 50% cost increase” is a message that needs taking with a degree of context.