I am writing a Pin tool and it seems to add a significant time overhead.
My tool must instrument the program in the granularity of an instruction.
To check for the overhead source I wrote a small Pin-tool that just counts the instruction by
instrumentation every instruction (as I must do in my tool).
In addition I wrote a simple program that checks a registry value (The C code is around 20 lines).
(Running on an i7 CPU, Windows 7)
When running the simple program, it takes almost immediately to return.
When running the Pin tool init and the program with no instrumentation at all it takes 2.35+- sec
When running the Pin tool with the simple instruction instrumentation it takes 5-6 sec
Number of instructions: 3,107,098.
I have tried it also on a more complex code, a program that loops over a recursion function.
Without Pin it takes around 1 min.
With Pin (that only counts the instructions) it takes around 7 min.
The number of instructions was: 1,850,919,077
Is this the expected overhead?