add performance counter
make performance logging optional