diff --git oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/Revision.java oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/Revision.java
index 26634e3..9b115cf 100644
--- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/Revision.java
+++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/Revision.java
@@ -220,29 +220,47 @@ public final class Revision implements CacheValue {
     }
 
     public static Revision fromString(String rev) {
-        boolean isBranch = false;
-        if (rev.startsWith("b")) {
-            isBranch = true;
-            rev = rev.substring(1);
-        }
-        if (!rev.startsWith("r")) {
-            throw new IllegalArgumentException(rev);
+        boolean isBranch = rev.charAt(0) == 'b';
+        int start = isBranch ? 2 : 1;
+        long timestamp = 0;
+        int clusterId = 0;
+        int counter = 0;
+
+        int idx = start;
+        int digit;
+        //Parse timestamp
+        for (; idx < rev.length(); idx++) {
+            char c = rev.charAt(idx);
+            if (c == '-') {
+                timestamp = -timestamp;
+                break;
+            }
+            digit = c >= 'a'? c - 'a' + 10 : c - '0';
+            timestamp = timestamp << 4;
+            timestamp -= digit;
         }
-        int idxCount = rev.indexOf('-');
-        if (idxCount < 0) {
-            throw new IllegalArgumentException(rev);
+
+        //Parse counter
+        for (idx++; idx < rev.length(); idx++) {
+            char c = rev.charAt(idx);
+            if (c == '-') {
+                counter = -counter;
+                break;
+            }
+            digit = c >= 'a'? c - 'a' + 10 : c - '0';
+            counter = counter << 4;
+            counter -= digit;
         }
-        int idxClusterId = rev.indexOf('-', idxCount + 1);
-        if (idxClusterId < 0) {
-            throw new IllegalArgumentException(rev);
+
+        //Parse clusterId
+        for (idx++; idx < rev.length(); idx++) {
+            char c = rev.charAt(idx);
+            digit = c >= 'a'? c - 'a' + 10 : c - '0';
+            clusterId = clusterId << 4;
+            clusterId -= digit;
         }
-        String t = rev.substring(1, idxCount);
-        long timestamp = Long.parseLong(t, 16);
-        t = rev.substring(idxCount + 1, idxClusterId);
-        int c = Integer.parseInt(t, 16);
-        t = rev.substring(idxClusterId + 1);
-        int clusterId = Integer.parseInt(t, 16);
-        return new Revision(timestamp, c, clusterId, isBranch);
+        clusterId = -clusterId;
+        return new Revision(timestamp, counter, clusterId, isBranch);
     }
 
     @Override
@@ -258,21 +276,25 @@ public final class Revision implements CacheValue {
      * @return the StringBuilder instance passed to this method.
      */
     public StringBuilder toStringBuilder(StringBuilder sb) {
-        if (branch) {
+        if (branch){
             sb.append('b');
         }
         sb.append('r');
-        sb.append(Long.toHexString(timestamp)).append('-');
+        toHexString(sb, timestamp);
+        sb.append('-');
+
+
         if (counter < 10) {
             sb.append(counter);
         } else {
-            sb.append(Integer.toHexString(counter));
+            toHexString(sb, counter);
         }
         sb.append('-');
+
         if (clusterId < 10) {
             sb.append(clusterId);
         } else {
-            sb.append(Integer.toHexString(clusterId));
+            toHexString(sb, clusterId);
         }
         return sb;
     }
@@ -371,4 +393,55 @@ public final class Revision implements CacheValue {
     public int getMemory() {
         return SHALLOW_MEMORY_USAGE;
     }
+
+    private static void toHexString(StringBuilder sb, long l) {
+        int count = 1;
+        long j = l;
+
+        if (l < 0) {
+            count = 16;
+        } else {
+            while ((j >>= 4) != 0) {
+                count++;
+            }
+        }
+
+        char[] buffer = new char[count];
+        do {
+            int t = (int) (l & 15);
+            if (t > 9) {
+                t = t - 10 + 'a';
+            } else {
+                t += '0';
+            }
+            buffer[--count] = (char) t;
+            l >>= 4;
+        } while (count > 0);
+        sb.append(buffer);
+    }
+
+    private static void toHexString(StringBuilder sb, int i) {
+        int count = 1, j = i;
+
+        if (i < 0) {
+            count = 8;
+        } else {
+            while ((j >>>= 4) != 0) {
+                count++;
+            }
+        }
+
+        char[] buffer = new char[count];
+        do {
+            int t = i & 15;
+            if (t > 9) {
+                t = t - 10 + 'a';
+            } else {
+                t += '0';
+            }
+            buffer[--count] = (char) t;
+            i >>>= 4;
+        } while (count > 0);
+        sb.append(buffer);
+    }
 }
diff --git oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/RevisionVector.java oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/RevisionVector.java
index f2f327b..09e1511 100644
--- oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/RevisionVector.java
+++ oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/RevisionVector.java
@@ -55,8 +55,15 @@ public final class RevisionVector implements Iterable<Revision>, Comparable<Revi
 
     private final static RevisionVector EMPTY = new RevisionVector();
 
+    private final static int REV_STRING_SIZE;
+
     private final Revision[] revisions;
 
+    static {
+        //approx revision string size. Extra 2 is for the case where counter or clusterId > 10
+        REV_STRING_SIZE = Revision.newRevision(0).toString().length() + 2;
+    }
+
     private RevisionVector(@Nonnull Revision[] revisions,
                            boolean checkUniqueClusterIds,
                            boolean sort) {
@@ -320,7 +327,8 @@ public final class RevisionVector implements Iterable<Revision>, Comparable<Revi
      * @return a string representation of this revision vector.
      */
     public String asString() {
-        StringBuilder sb = new StringBuilder();
+        //Ensure that buffer is sized to accommodate the revision string form
+        StringBuilder sb = new StringBuilder(REV_STRING_SIZE * revisions.length + revisions.length);
         String comma = "";
         for (Revision r : revisions) {
             sb.append(comma);
