javascript tests about function and performance