ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [33/50] [abbrv] incubator-ignite git commit: ignite-950: performance optimizations
Date Tue, 30 Jun 2015 10:51:54 GMT
ignite-950: performance optimizations


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/347fbe14
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/347fbe14
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/347fbe14

Branch: refs/heads/ignite-950
Commit: 347fbe1403fa17384bda20b7be9dce5536146263
Parents: 8df8771
Author: Denis Magda <dmagda@gridgain.com>
Authored: Fri Jun 26 13:22:49 2015 +0300
Committer: Denis Magda <dmagda@gridgain.com>
Committed: Fri Jun 26 13:22:49 2015 +0300

----------------------------------------------------------------------
 .../optimized/OptimizedObjectInputStream.java   | 24 +++++++++++++-------
 1 file changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/347fbe14/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectInputStream.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectInputStream.java
b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectInputStream.java
index b941c41..6e7d7d6 100644
--- a/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectInputStream.java
+++ b/modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectInputStream.java
@@ -80,6 +80,9 @@ public class OptimizedObjectInputStream extends ObjectInputStream implements
Opt
     /** */
     private Stack<HashMap<Integer, Object>> marshalAwareValues;
 
+    /** */
+    private FieldRange range;
+
     /**
      * @param in Input.
      * @throws IOException In case of error.
@@ -1423,14 +1426,22 @@ public class OptimizedObjectInputStream extends ObjectInputStream
implements Opt
             }
 
             if (info.id() == fieldId) {
+                if (range == null)
+                    range = new FieldRange();
+
                 if (!isHandle) {
                     //object header len: 1 - for type, 4 - for type ID, 2 - for checksum.
                     fieldOff += 1 + 4 + clsNameLen + 2;
 
-                    return new FieldRange(start + fieldOff, len);
+                    range.start = start + fieldOff;
+                    range.len = len;
                 }
-                else
-                    return new FieldRange(in.readInt(pos), in.readInt(pos + 4));
+                else {
+                    range.start = in.readInt(pos);
+                    range.len = in.readInt(pos + 4);
+                }
+
+                return range;
             }
             else {
                 fieldOff += len;
@@ -1456,12 +1467,9 @@ public class OptimizedObjectInputStream extends ObjectInputStream implements
Opt
         private int len;
 
         /**
-         * @param start Start.
-         * @param len   Length.
+         * Constructor.
          */
-        public FieldRange(int start, int len) {
-            this.start = start;
-            this.len = len;
+        public FieldRange() {
         }
     }
     /** {@inheritDoc} */


Mime
View raw message