directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1749647 - /directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java
Date Wed, 22 Jun 2016 10:34:16 GMT
Author: elecharny
Date: Wed Jun 22 10:34:16 2016
New Revision: 1749647

URL: http://svn.apache.org/viewvc?rev=1749647&view=rev
Log:
Speedup the serialization/deserialization by writing the ID instead of computing it.

Modified:
    directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java

Modified: directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java?rev=1749647&r1=1749646&r2=1749647&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java
(original)
+++ directory/shared/branches/shared-value/ldap/model/src/main/java/org/apache/directory/api/ldap/model/entry/DefaultAttribute.java
Wed Jun 22 10:34:16 2016
@@ -2001,8 +2001,11 @@ public class DefaultAttribute implements
     @Override
     public void writeExternal( ObjectOutput out ) throws IOException
     {
-        // Write the UPId (the id will be deduced from the upID)
+        // Write the UPId
         out.writeUTF( upId );
+        
+        // Write the ID
+        out.writeUTF( id );
 
         // Write the HR flag, if not null
         if ( isHR != null )
@@ -2041,8 +2044,11 @@ public class DefaultAttribute implements
         // Read the ID and the UPId
         upId = in.readUTF();
 
-        // Compute the id
-        setUpId( upId );
+        // Read the id
+        id = in.readUTF();
+        
+        // We could have computed it, but it costs more than reading it from the disk...
+        //setUpIdInternal( upId );
 
         // Read the HR flag, if not null
         if ( in.readBoolean() )



Mime
View raw message