8220166: Performance regression in deserialization (4-6% in SPECjbb)
authorrriggs
Fri, 17 May 2019 10:48:02 -0400
changeset 54926 d4e7ccaf1445
parent 54925 3205f4c40716
child 54927 1512d88b24c6
8220166: Performance regression in deserialization (4-6% in SPECjbb) Reviewed-by: shade, dholmes, alanb
src/java.base/share/classes/java/io/ObjectInputFilter.java
--- 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;
         }
 
         /**