4 ms·
Actually synchronized is not that expensive in itself. Especially in modern implementations it's not bad at all. It always used to amuse me how Java developer
by zmimon 17y ago
Actually synchronized is not that expensive in itself. Especially in modern implementations it's not bad at all. It always used to amuse me how Java developers would go to contortions trying not to synchronize a method and then they'd fill it up with calls to things like Vector (every method synchronized!), StringBuffer (yep, every method synchronized!) and any number of other calls that are synchronized in the default JDK.