I'm optimizing a large C project whose integer arithmetic presently uses int
. I'm considering switching to int_fast16_t
(or even int_fast8_t
) wherever a small integer is sufficient. This'll be a reasonably big job, so before I set out, I want to be confident that this has the potential to decrease run-time noticeably (> 5–10%) for users running the software on modern PCs.
As this will depend on the compiler and hardware (edited to clarify: this will differ from end-user to end-user -- so it's hard to know how representative benchmarking on my own PC would be), I appreciate that this is something of a "how long's a piece of string" question – but is there a rule of thumb for what sort of order of magnitude of speed-up I might hope to gain? Are particular categories of operation particularly likely to yield a benefit?
Related: