Skip to main content
9 events
when toggle format what by license comment
Mar 31, 2011 at 20:57 comment added Cercerilla This is pretty much my thought as well. There are things that I would classify as optimizations, but sometimes it seems quite obvious that it's going to be a bottleneck. When I know that I'm trying to squeeze all the performance I can out of the hardware, sometimes it makes sense to do a little performance tweaking while I'm working in a function if it won't hurt maintainability and is going to be called a lot.
Mar 31, 2011 at 15:13 comment added unholysampler @dbyrne: This. You said it better than I did.
Mar 31, 2011 at 15:11 comment added unholysampler @BerinLoritsch: There are never perfect generalizations, but many compilers can optimize, especially when the result is not being stored anywhere. I am more focused on the fact that there a likely other things you will be able to change that have a much bigger impact than changing how you increment a number.
Mar 31, 2011 at 15:06 comment added dbyrne @Berin most (all?) fine-grained optimizations depend on the processor and what the compiler produces. Thats why its not bad to make some obvious, high-level optimizations early on, and wait until after you've done some profiling to do any sort of micro-tuning.
Mar 31, 2011 at 15:05 comment added David Thornley @unholysampler: There is the fact that ++i will always be at least as good as i++, but the reverse isn't true.
Mar 31, 2011 at 15:03 history edited dbyrne CC BY-SA 2.5
deleted 12 characters in body
Mar 31, 2011 at 15:00 comment added Berin Loritsch @unholysampler, doesn't that really depend on the processor and what the compiler produces? Those types of optimizations will work on some machines and not others. Kind of silly if you ask me.
Mar 31, 2011 at 14:49 comment added unholysampler +1: There has been so much talk about i++ vs ++i it makes me want to punch babies.
Mar 31, 2011 at 14:44 history answered dbyrne CC BY-SA 2.5