Hum, interesting. How did you do the tests? Some tool to measure the speed? It would be interesting to do the same for the attachments. Personally I think that for text mime types, it's generally worth doing the compression.
On Tue, Jan 26, 2010 at 4:14 PM, Paul Davis <[email protected]>wrote: > Huh. Maybe we turned that off? We did sit down and do some tests for > the speed/size tradeoffs of using compression. > > The call was just adding the compressed option to > erlang:term_to_binary/2 before writing that to disk. I'm not seeing it > either though. > > I reckon we just decided to go with no compression for speed. > > Paul Davis > > On Tue, Jan 26, 2010 at 9:55 AM, Filipe David Manana <[email protected]> > wrote: > > Paul, > > > > I don't see anything on couch_file that does compression (looking at > trunk). > > I grepped all the couch .erl files for "gzip" and "zlib", and the only > ones > > who are using compression are from the replication feature. > > $ egrep -nr 'gzip|zlib' *.erl > > couch_rep_att.erl:66: if ContentEncoding =:= "gzip" -> > > couch_rep_att.erl:67: zlib:gunzip(Data); > > couch_rep_changes_feed.erl:64: headers = Source#http_db.headers -- > > [{"Accept-Encoding", "gzip"}] > > couch_rep_httpc.erl:202: "gzip" -> > > couch_rep_httpc.erl:203: zlib:gunzip(Body); > > > > Doing a quick eye scan on couch_file, I don't find anything also. > > Am I missing something? > > On Tue, Jan 26, 2010 at 3:24 PM, Paul Davis <[email protected] > > > > wrote: > >> > >> > I do have the same opinion as you, the code would affect many of the > >> > parts > >> > regarding the compression (specially couch_stream). For doc > compression, > >> > I > >> > imagine it would touch more places, and also present some difficulties > >> > to > >> > assure compatibility with the previous DB file formats. > >> > >> Just a note that docs are already stored compressed on disk. > >> Everything written through couch_file.erl gets a gzip compression > >> level 6 applied if memory serves. Which suddenly makes me wonder if an > >> optimization for attachment compression might benefit from turning > >> that off during stream writes since the stream is already compressed. > >> > >> Just a couple random thoughts. > >> > >> Paul > > > > > > > > -- > > Filipe David Manana, > > [email protected] > > PGP key - http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC569452B > > > > "Reasonable men adapt themselves to the world. > > Unreasonable men adapt the world to themselves. > > That's why all progress depends on unreasonable men." > > > > > -- Filipe David Manana, [email protected] PGP key - http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC569452B "Reasonable men adapt themselves to the world. Unreasonable men adapt the world to themselves. That's why all progress depends on unreasonable men."
