Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 24582D3EC for ; Mon, 8 Oct 2012 09:36:06 +0000 (UTC) Received: (qmail 97281 invoked by uid 500); 8 Oct 2012 09:36:05 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 97003 invoked by uid 500); 8 Oct 2012 09:36:04 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 96668 invoked by uid 99); 8 Oct 2012 09:36:02 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Oct 2012 09:36:02 +0000 Date: Mon, 8 Oct 2012 09:36:02 +0000 (UTC) From: "Adrien Grand (JIRA)" To: dev@lucene.apache.org Message-ID: <1867098077.8220.1349688962778.JavaMail.jiratomcat@arcas> In-Reply-To: <389874577.59186.1342461515785.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Resolved] (LUCENE-4226) Efficient compression of small to medium stored fields MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LUCENE-4226?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] Adrien Grand resolved LUCENE-4226. ---------------------------------- Resolution: Fixed lucene-core tests have passed the whole week-end so I just committed to bra= nch 4.x as well. Thank you again for the Jenkins job, Simon. =20 > Efficient compression of small to medium stored fields > ------------------------------------------------------ > > Key: LUCENE-4226 > URL: https://issues.apache.org/jira/browse/LUCENE-4226 > Project: Lucene - Core > Issue Type: Improvement > Components: core/index > Reporter: Adrien Grand > Assignee: Adrien Grand > Priority: Trivial > Fix For: 4.1, 5.0 > > Attachments: CompressionBenchmark.java, CompressionBenchmark.java= , LUCENE-4226.patch, LUCENE-4226.patch, LUCENE-4226.patch, LUCENE-4226.patc= h, LUCENE-4226.patch, LUCENE-4226.patch, LUCENE-4226.patch, LUCENE-4226.pat= ch, SnappyCompressionAlgorithm.java > > > I've been doing some experiments with stored fields lately. It is very co= mmon for an index with stored fields enabled to have most of its space used= by the .fdt index file. To prevent this .fdt file from growing too much, o= ne option is to compress stored fields. Although compression works rather w= ell for large fields, this is not the case for small fields and the compres= sion ratio can be very close to 100%, even with efficient compression algor= ithms. > In order to improve the compression ratio for small fields, I've written = a {{StoredFieldsFormat}} that compresses several documents in a single chun= k of data. To see how it behaves in terms of document deserialization speed= and compression ratio, I've run several tests with different index compres= sion strategies on 100,000 docs from Mike's 1K Wikipedia articles (title an= d text were indexed and stored): > - no compression, > - docs compressed with deflate (compression level =3D 1), > - docs compressed with deflate (compression level =3D 9), > - docs compressed with Snappy, > - using the compressing {{StoredFieldsFormat}} with deflate (level =3D 1= ) and chunks of 6 docs, > - using the compressing {{StoredFieldsFormat}} with deflate (level =3D 9= ) and chunks of 6 docs, > - using the compressing {{StoredFieldsFormat}} with Snappy and chunks of= 6 docs. > For those who don't know Snappy, it is compression algorithm from Google = which has very high compression ratios, but compresses and decompresses dat= a very quickly. > {noformat} > Format Compression ratio IndexReader.document time > =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 > uncompressed 100% 100% > doc/deflate 1 59% 616% > doc/deflate 9 58% 595% > doc/snappy 80% 129% > index/deflate 1 49% 966% > index/deflate 9 46% 938% > index/snappy 65% 264% > {noformat} > (doc =3D doc-level compression, index =3D index-level compression) > I find it interesting because it allows to trade speed for space (with de= flate, the .fdt file shrinks by a factor of 2, much better than with doc-le= vel compression). One other interesting thing is that {{index/snappy}} is a= lmost as compact as {{doc/deflate}} while it is more than 2x faster at retr= ieving documents from disk. > These tests have been done on a hot OS cache, which is the worst case for= compressed fields (one can expect better results for formats that have a h= igh compression ratio since they probably require fewer read/write operatio= ns from disk). -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org