c - how to count cycles? -


i'm trying find find relative merits of 2 small functions in c. 1 adds loop, 1 adds explicit variables. functions irrelevant themselves, i'd teach me how count cycles compare algorithms. f1 take 10 cycles, while f2 take 8. that's kind of reasoning do. no performance measurements (e.g. gprof experiments) @ point, old instruction counting.

is there way this? there tools? documentation? i'm writing c, compiling gcc on x86 architecture.

http://icl.cs.utk.edu/papi/

papi_get_real_cyc(3) - return total number of cycles since arbitrary starting point


Comments

Popular posts from this blog

razor - Is this a bug in WebMatrix PageData? -

iphone - Requiring the presence of a method in an id -

xslt - Is it possible to select a node that just includes a subset of the child nodes? -