chaokunyang commented on code in PR #2007:
URL: https://github.com/apache/fury/pull/2007#discussion_r1916989853
##########
python/pyfury/_util.pyx:
##########
@@ -572,12 +573,15 @@ cdef class Buffer:
cdef uint64_t header = self.read_varuint64()
cdef uint32_t size = header >> 2
self.check_bound(self.reader_index, size)
+ if size == 0:
+ return ""
cdef const char * buf = <const char *>(self.c_buffer.get().data() +
self.reader_index)
self.reader_index += size
cdef uint32_t encoding = header & <uint32_t>0b11
if encoding == 0:
# PyUnicode_FromASCII
- return PyUnicode_DecodeLatin1(buf, size, "strict")
+ return <unicode>Fury_PyUnicode_FromUCS1(buf, size)
+ # return PyUnicode_DecodeLatin1(buf, size, "strict")
Review Comment:
If i use PyUnicode_DecodeLatin1 directly here, It's faster in macos, which
is unexpected Since my implementation used the simd, and if i invoke
PyUnicode_DecodeLatin1 directly in PyUnicode_FromUCS1, it's slower too.
@penguin-wwy do you have any ideas?
--
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]