make local for struct.X, math.X
add performance test for encoding messages