A framework for semi-automatically performance tuning generic software