8220166: Performance regression in deserialization (4-6% in SPECjbb)
Reviewed-by: shade, dholmes, alanb
--- a/src/java.base/share/classes/java/io/ObjectInputFilter.java Thu May 16 21:25:53 2019 +0800
+++ b/src/java.base/share/classes/java/io/ObjectInputFilter.java Fri May 17 10:48:02 2019 -0400
@@ -283,7 +283,7 @@
/**
* Current configured filter.
*/
- private static ObjectInputFilter serialFilter = configuredFilter;
+ private static volatile ObjectInputFilter serialFilter = configuredFilter;
/**
* Returns the system-wide serialization filter or {@code null} if not configured.
@@ -291,9 +291,7 @@
* @return the system-wide serialization filter or {@code null} if not configured
*/
public static ObjectInputFilter getSerialFilter() {
- synchronized (serialFilterLock) {
- return serialFilter;
- }
+ return serialFilter;
}
/**