-
Hi, From the sample usage code of mz_zip_reader_entry_read it provides a do while loop. This can lead multiple steps to finish one entry reading if the input buffer is too small or the entry is too large. Will this be a valid performance concern if call this API multiple times? One way I worked around of the usage is leverage the
I would like to hear if there is any recommended usage of this method. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It can be called a single time if you have enough space for the uncompressed data. Or it can be called multiple times if you do not have a buffer big enough. Calling it once is going to lead to better performance. However, many times it is not possible to create a buffer the size of the uncompressed data, especially if there is a lot of it. If you know you are only going to be dealing with small entries, it makes sense. But if you don't know the size of the entries you are dealing with then it makes sense to just use a good-sized buffer and call it multiple times. |
Beta Was this translation helpful? Give feedback.
It can be called a single time if you have enough space for the uncompressed data. Or it can be called multiple times if you do not have a buffer big enough. Calling it once is going to lead to better performance. However, many times it is not possible to create a buffer the size of the uncompressed data, especially if there is a lot of it. If you know you are only going to be dealing with small entries, it makes sense. But if you don't know the size of the entries you are dealing with then it makes sense to just use a good-sized buffer and call it multiple times.