synchronized method and block optimaize