Good ways to optimise/optimize code?

Started by
31 comments, last by tom76 22 years, 5 months ago
One last quick (and easy to answer) question. Is the keyword "register" a placebo, as I''ve heard?

The trouble with finding stuff on the ''Net about optimisation is that everywhere you turn, something contradicts what you know. Why can''t computers just stop evolving? Everyone can be given a ZX Speccy and we''d all be happy.

It''s funny, but I got more fun from a couple of hours worth of being a jerk here than I did from years of helping on newsgroups. I guess the conclusion is obvious - I am evil (but in an o.o. sort of way).

Btw, I knew exactly what I was doing when I argued. Here''s a link that might be interesting: A List of Fallacious Arguments. Try seeing how many I used (must be a few, surely!).

Alistair Keys

P.S. I''m away to help find lost children and to feed the starving world.
Advertisement
quote:Original post by Anonymous Poster
One last quick (and easy to answer) question. Is the keyword "register" a placebo, as I''ve heard?


It''s an indication of preference. The compiler becomes more likely to use a register for that variable, but it is free to ignore the keyword if it thinks it can optimize better than you.
Kylotan: Touche''.

re: keyword register: it may not matter much when developing for a PC target. It matters a lot when developing for a 8-bit 10MHz 3-register controller (yeah, I did that, lots of fun, esp. 256 bytes of stack space, 128 of which are reserved).

This topic is closed to new replies.

Advertisement