fix deepCompare
optimize trace generation