0

Introduction

I have a couple of small and simple questions on the xz-java library.
In addition to asking the questions here I have asked the library author same questions by sending an email message.

The xz command-line tool supports the «Extreme» presets: see the -0e-9e command-line options.

An excerpt from man xz to show both (regular and extreme) preset families:

<…>

The following table summarises the features of the presets:

     Preset   DictSize   CompCPU   CompMem   DecMem
       -0     256 KiB       0        3 MiB    1 MiB
       -1       1 MiB       1        9 MiB    2 MiB
       -2       2 MiB       2       17 MiB    3 MiB
       -3       4 MiB       3       32 MiB    5 MiB
       -4       4 MiB       4       48 MiB    5 MiB
       -5       8 MiB       5       94 MiB    9 MiB
       -6       8 MiB       6       94 MiB    9 MiB
       -7      16 MiB       6      186 MiB   17 MiB
       -8      32 MiB       6      370 MiB   33 MiB
       -9      64 MiB       6      674 MiB   65 MiB

<…>

-e, --extreme
      Use a slower variant of the selected compression preset level (-0 ... -9) to hopefully get a little bit better compression ratio, but with bad luck this can also  make  it
      worse.  Decompressor memory usage is not affected, but compressor memory usage increases a little at preset levels -0 ... -3.

      Since  there  are  two  presets with dictionary sizes 4 MiB and 8 MiB, the presets -3e and -5e use slightly faster settings (lower CompCPU) than -4e and -6e, respectively.
      That way no two presets are identical.

             Preset   DictSize   CompCPU   CompMem   DecMem
              -0e     256 KiB       8        4 MiB    1 MiB
              -1e       1 MiB       8       13 MiB    2 MiB
              -2e       2 MiB       8       25 MiB    3 MiB
              -3e       4 MiB       7       48 MiB    5 MiB
              -4e       4 MiB       8       48 MiB    5 MiB
              -5e       8 MiB       7       94 MiB    9 MiB
              -6e       8 MiB       8       94 MiB    9 MiB
              -7e      16 MiB       8      186 MiB   17 MiB
              -8e      32 MiB       8      370 MiB   33 MiB
              -9e      64 MiB       8      674 MiB   65 MiB

<…>

Questions

1. Are extreme presets supported by the xz-java library?

I have taken a brief look at the source code and I have not found such support (org.tukaani.xz.LZMA2Options class).

2. If extreme presets are not supported, is there any way to introduce their support in the client code?

apaderno
  • 28,547
  • 16
  • 75
  • 90
  • 1
    Isn't [`PRESET_MAX`](https://tukaani.org/xz/xz-javadoc/org/tukaani/xz/LZMA2Options.html#PRESET_MAX) the option you're looking for? Incidentally its value is 9, so it looks like the correct one. – Federico klez Culloca Jul 30 '21 at 16:00
  • @FedericoklezCulloca, yes, there is the `9` preset. But I would like to use the **extreme** version of this preset. Updated the question with the excerpt from the `xz` manual page to show both (regular and extreme) preset families. – Sergey Vyacheslavovich Brunov Jul 30 '21 at 16:24
  • 1
    Hm, why ask that here instead of over on https://sourceforge.net/p/lzmautils/discussion/708858 (as listed over on https://tukaani.org/xz/java.html)? Or at the very least, asking here _as well as_ the official xz-java communities? – Mike 'Pomax' Kamermans Jul 30 '21 at 16:31
  • @Mike'Pomax'Kamermans, please, note that [XZ Utils download | SourceForge.net](https://sourceforge.net/projects/lzmautils/) is about the `xz` command-line tool, not the `xz-java` Java library. In addition to asking here I have asked the library author same questions by sending an email message. – Sergey Vyacheslavovich Brunov Jul 30 '21 at 16:43
  • 1
    Nice! Please remember to also mention that in your post, so folks know you're on top of exhausting all avenues instead of reaching for SO out of convenience =) – Mike 'Pomax' Kamermans Jul 30 '21 at 16:45
  • @Mike'Pomax'Kamermans, I agree with you: it is a good idea. Updated the question. – Sergey Vyacheslavovich Brunov Jul 30 '21 at 16:49

0 Answers0