|
Boost Users : |
Subject: Re: [Boost-users] Increase iostream zlib filter buffer size
From: rajiv82 (rajiv82_at_[hidden])
Date: 2011-03-20 05:41:24
Yes, using gzip_compressor(zl_params, 10485760) , doesn't increase the buffer
size.
I tried few things , and it worked now. Modified code:
Code snippet
------------------
std::ofstream ofs(outPath.c_str() ,
std::ios::out|std::ios::binary|std::ios::trunc);
{
boost::iostreams::filtering_streambuf out;
out.push(boost::iostreams::gzip_compressor();
out.push();
{
boost::archive::binary_oarchive oa(out);
oa << data;
}
}
Without enclosing code in braces, it takes time with 100% cpu. After
enclosing in braces, it seems to be very fast.
No idea how enclosing in braces increases the speed. Any suggestion ?
After solving this issue, I came across with another issue.
I had written decompresser with gzip, standalone utility works fine, but
when I embed same code in my multi-threaded application, filestream stuck in
waiting for lock(scoped_lock).
Please suggest. If you want I can post the gdb stack trace.
-- View this message in context: http://boost.2283326.n4.nabble.com/Increase-iostream-zlib-filter-buffer-size-tp3354705p3390886.html Sent from the Boost - Users mailing list archive at Nabble.com.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net