grunge fightr
grunge fightr

Reputation: 1370

way of measuring branch prediction hit rate

I am writing C procedures under winapi.

Is there some convenient way of measuring "branch prediction hit rate" for chosen procedure/loop ? Especialy compiler agnostic and reliable way (I mean with reliable results not spoiled by something).

Upvotes: 1

Views: 451

Answers (1)

Jochen Kalmbach
Jochen Kalmbach

Reputation: 3684

There is a tool from valgrind (Cachegrind: a cache and branch-prediction profiler): http://valgrind.org/docs/manual/cg-manual.html

Also be aware of this article: Why is it faster to process a sorted array than an unsorted array?

Upvotes: 1

Related Questions