philippeVerney commented on PR #3546: URL: https://github.com/apache/avro/pull/3546#issuecomment-3542822093
Indeed, this is a more general solution but it would need either to read twice the entire array or to "seekg" (i.e. to set the input position indicator of the input stream) several times which may in both cases impact performance. In both cases, we would need to seekg to the beginning of the array before the second iteration. We would also need to change the underlying [InputStream](https://github.com/apache/avro/blob/a663e54d738c4050880e7020d873221b3803241e/lang/c%2B%2B/include/avro/Stream.hh#L35) to an [SeekableInputStream ](https://github.com/apache/avro/blob/a663e54d738c4050880e7020d873221b3803241e/lang/c%2B%2B/include/avro/Stream.hh#L84C17-L84C37) if [I understand correctly](https://github.com/apache/avro/blob/a663e54d738c4050880e7020d873221b3803241e/lang/c%2B%2B/impl/BinaryDecoder.cc#L29). The change would look more heavy, further from the corresponding JIRA issue and, I don't know on top of my head if it would generally be faster or not. For a single block array which is the current encoding implementation, I guess it would be a little bit slower cause of the seekg cost. -- 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]
