chaokunyang commented on code in PR #1313:
URL: https://github.com/apache/incubator-fury/pull/1313#discussion_r1443784379


##########
javascript/packages/fury/lib/reader.ts:
##########
@@ -144,21 +190,67 @@ export const BinaryReader = (config: Config) => {
     return (v >> 1) ^ -(v & 1);
   }
 
+  function zigZagBigInt(v: bigint) {
+    return (v >> 1n) ^ -(v & 1n);
+  }
+
   function varUInt32() {
-    let byte_ = int8();
+    let byte_ = uint8();
     let result = byte_ & 0x7f;
     if ((byte_ & 0x80) != 0) {
-      byte_ = int8();
+      byte_ = uint8();
       result |= (byte_ & 0x7f) << 7;
       if ((byte_ & 0x80) != 0) {
-        byte_ = int8();
+        byte_ = uint8();
         result |= (byte_ & 0x7f) << 14;
         if ((byte_ & 0x80) != 0) {
-          byte_ = int8();
+          byte_ = uint8();
           result |= (byte_ & 0x7f) << 21;
           if ((byte_ & 0x80) != 0) {
-            byte_ = int8();
-            result |= (byte_ & 0x7f) << 28;
+            byte_ = uint8();
+            result |= (byte_) << 28;
+          }
+        }
+      }
+    }
+    return result;
+  }
+
+  function bigUInt8() {
+    return BigInt(uint8() >>> 0);
+  }
+
+  function varUInt64() {
+    let byte_ = bigUInt8();

Review Comment:
   If remaing bytes is greater than 8, we can get a long first, and check its 
bits. This will have better performance than read byte by byte



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to