Introduce rdtsc, cycle delay primitives.
commita0ae83d0fdee0690b8b1b660a6a656bda5891a37
authorKeith Adams <kma@fb.com>
Thu, 27 Jun 2013 21:35:22 +0000 (27 14:35 -0700)
committerSara Golemon <sgolemon@fb.com>
Mon, 1 Jul 2013 20:40:55 +0000 (1 13:40 -0700)
tree3b70b7d1f5ab5cc7a03c1bf7f47cbbab2f4e316f
parent652f0e7b2a6db3e11f78b720f08dcb66751ec66a
Introduce rdtsc, cycle delay primitives.

I keep reintroducing these by hand. My workflow is usually:

1. Have an idea to optimize X.
2. Realize I don't even know if X is important or not.
3. Instrument X to slow it down, to see if it makes a difference in
   perflab.

After this diff, 3 is a simple matter of inserting a call to
cycleDelay(1000) (or what have you) in the path of interest.
hphp/runtime/ext/ext_hotprofiler.cpp
hphp/runtime/vm/jit/translator-x64.cpp
hphp/util/cycles.h [new file with mode: 0644]