Bug 1188866 - Performance regression in virt-builder when uncompressing image
Summary: Performance regression in virt-builder when uncompressing image
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-03 21:20 UTC by Richard W.M. Jones
Modified: 2015-02-04 13:37 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-04 13:37:45 UTC
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2015-02-03 21:20:41 UTC
Description of problem:

Somehow in Fedora 21 the uncompression stage takes much longer
than it used to:

$ virt-builder fedora-20
[   1.0] Downloading: http://libguestfs.org/download/builder/fedora-20.xz
[   2.0] Planning how to build this image
[   2.0] Uncompressing        <----
[  98.0] Opening the new disk <-----

This used to be something like 10 seconds.

Version-Release number of selected component (if applicable):

libguestfs 1.29.24
xz-5.1.2-14alpha.fc21.x86_64

How reproducible:

Unknown - I don't have exact measurements from previously.

Comment 1 Richard W.M. Jones 2015-02-04 13:19:23 UTC
This turned out to be caused by:

https://github.com/libguestfs/libguestfs/commit/9135129b0f6e8eb171131ea0f7d729a960b74cb3

where two stack buffers had been changed to pointers:

-  uint8_t buf[BUFFER_SIZE];
-  unsigned char outbuf[BUFFER_SIZE];
+  CLEANUP_FREE uint8_t *buf = NULL;
+  CLEANUP_FREE uint8_t *outbuf = NULL;

but we were still using sizeof buf to calculate the size of
the buffer.  sizeof buf == 8 so the original code which used
large buffers for reading/writing the file changed to using
8 byte buffers.

Upstream fix coming shortly.  Luckily this doesn't affect any
stable branches.


Note You need to log in before you can comment on or make changes to this bug.