LiangliangSui commented on PR #1650: URL: https://github.com/apache/incubator-fury/pull/1650#issuecomment-2133807811
> Hi @LiangliangSui , could you elabrate more why we need this optimization? I don't see the performance loss before this PR Let's take `_readVarInt32OnLE` as an example. When `size - readIdx >= 4`, we can use `UNSAFE.getInt` to read out 4 bytes at a time. We do not need `size - readIdx >= 5` to read out 4 bytes at a time. If `size - readIdx == 4`, according to the previous logic, we need to execute `readByte()` 4 times (read from memory 4 times), and the optimized logic only requires one getInt (operate the memory once). The reason why we name some reading methods `readVarXXXSlow` should be that these methods will loop through `readByte()` to read data. Is my understanding correct? -- 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]
