Bug 234217 - Change compilation option for libarchive
Summary: Change compilation option for libarchive
Status: Closed DUPLICATE of bug 233543
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.2-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-20 15:13 UTC by Alexandre martins
Modified: 2018-12-20 16:10 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre martins 2018-12-20 15:13:07 UTC
Greetings,

Currently, the libarchive is compiled without the flag HAVE_LZMA_STREAM_ENCODER_MT. It may be nice to add this flag to allow compression on multiple CPU.

On my machine (4 CPU), if I compress 4GB of 0 in the standard way:

$ time tar --options threads=0 -cJf test.txz zero

real    1m18,200s
user    1m16,910s
sys     0m0,941s

When libarchive is compiled with the flag:

$ time tar --options threads=0 -cJf test.txz zero

real    0m21,810s
user    1m17,612s
sys     0m1,478s

The patch:
-+-+-+-+-+-+-
--- Makefile.orig       2018-12-20 16:09:26.863988000 +0100
+++ Makefile    2018-12-20 16:09:47.393163000 +0100
@@ -7,7 +7,7 @@ _LIBARCHIVEDIR= ${SRCTOP}/contrib/libarc
 LIB=   archive
 
 LIBADD=        z bz2 lzma bsdxml
-CFLAGS+= -DHAVE_BZLIB_H=1 -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1
+CFLAGS+= -DHAVE_BZLIB_H=1 -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 -DHAVE_LZMA_STREAM_ENCODER_MT=1
 
 # FreeBSD SHLIB_MAJOR value is managed as part of the FreeBSD system.
 # It has no real relation to the libarchive version number.
-+-+-+-+-+-+-

Best regards,

Alexandre
Comment 1 Conrad Meyer freebsd_committer freebsd_triage 2018-12-20 16:10:05 UTC
Dup of bug 233543?

See also r340997 and r341453.

For now, you can instead use:

  time tar --options -cf - zero | xz -T0 > test.txz

*** This bug has been marked as a duplicate of bug 233543 ***