One well-known source has cited that a synchronized method call is as much as 50 times slower than an unsynchronized method call.
一个著名的资料来源就曾经引证说一个同步的方法调用比一个非同步的方法调用慢 50 倍。
Even when a program contains only a single thread running on a single processor, a synchronized method call is still slower than an unsynchronized method call.
即使一个程序只包括一个在单一处理器上运行的单线程,一个同步的方法调用仍要比非同步的方法调用慢。
As more advanced JVMs have emerged, the cost of synchronization has decreased, but there is still a performance penalty for entering and leaving a synchronized method or block.
随着更高级的JVM的出现,同步的代价降低了,但出入synchronized方法或块仍然有性能损失。
应用推荐