You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using QAT (QuickAssist Technology) to compress and decompress 64KB chunks of data sequentially, and then concatenate them together. However, I have not observed any performance improvement for both compression and decompression, even though the hardware has been verified to be functioning correctly. Could you explain why this might be happening?
for compress:
qat_compress_string(StringInfo ibuffer, StringInfo obuffer, void *clevel, void *context)
{
int obytes, max_obytes;
int ret;
bool output = true;
AssertArg(ibuffer && obuffer);
max_obytes = LZ4_compressBound(ibuffer->len);
enlargeHugeStringInfo(obuffer, max_obytes);
QzSession_T sess={0};
ret = qzInit(&sess, 0);
if (QZ_DUPLICATE != ret && QZ_OK != ret) {
elog(ERROR,"Failed to initialize QAT ZIP library, %d\n", ret);
output = false;
goto close;
}
QzSessionParams_T params = {0};
//if (qzGetDefaults(¶ms) != QZ_OK)
// fprintf(stderr, "Failed to get params \n");
if (qzGetDefaultsLZ4(¶ms) != QZ_OK)
fprintf(stderr, "Failed to get params \n");
//params.comp_algorithm = QZ_LZ4;
params.comp_lvl = 1;
//params.hw_buff_sz = Qatzip_HardwareBufferSize_SZ_64K;
if (NULL == sess.internal || QZ_NONE == sess.hw_session_stat)
{
//ret = qzSetupSessionLZ4(&sess, NULL);
ret = qzSetupSession(&sess, NULL);
if (ret != QZ_OK)
{
elog(ERROR, "failed setup qat compress session");
output = false;
goto out;
}
}
int src_len = ibuffer->len;
int dest_len = max_obytes;
ret = qzCompress(&sess, (const char *) ibuffer->data, &src_len, obuffer->data + obuffer->len, &dest_len, 1);
if (dest_len <= 0)
{
elog(WARNING, "Fail to qat_compress_default");
output = false;
goto out;
}
/* No need to compress */
if (dest_len>= ibuffer->len)
{
elog(WARNING, "no need to compress");
output = false;
goto out;
}
obuffer->len += dest_len;
when I change the qzSetupSession(&sess, NULL); to qzSetupSessionLZ4(&sess, NULL), i get wrong result, the src_len is 4000, but the len of decompressed is 3438
I am using QAT (QuickAssist Technology) to compress and decompress 64KB chunks of data sequentially, and then concatenate them together. However, I have not observed any performance improvement for both compression and decompression, even though the hardware has been verified to be functioning correctly. Could you explain why this might be happening?
for compress:
qat_compress_string(StringInfo ibuffer, StringInfo obuffer, void *clevel, void *context)
{
int obytes, max_obytes;
int ret;
bool output = true;
out:
(void) qzTeardownSession(&sess);
close:
qzClose(&sess);
}
for decompress
qat_decompress_string(StringInfo ibuffer, StringInfo obuffer, int32 rawsize, void* context)
{
int obytes;
bool output = true;
out:
(void) qzTeardownSession(&sess);
qzClose(&sess);
}
The text was updated successfully, but these errors were encountered: