trace optimize