Skip to content

compress/bzip2: Slow performance #6754

@tomc603

Description

@tomc603
When decompressing file data from a bz2 compressed file, Go is much slower than other
popular languages' implementations.

For the simple sample program at http://play.golang.org/p/e0N9J8fsvz, I've incuded pprof
output for Go v 1.1 and 1.2rc2. The program walks a directory of BZ2 compressed text log
files, opens the file and passes the reader to a function that performs an io.copy() to
ioutil.discard. The results are almost exactly the same when processing each text line
from the reader with bufio.NewScanner().

Using large bufio readers or no bufio handling at all does not impact the overall
performance of the bzip2 functionality.

This test was conducted on 64bit Ubuntu Linux 13.10 using 64bit Go binaries. Go 1.2rc2
was downloaded directly from the Go site, whereas 1.1 was installed as an Ubuntu package.

Attachments:

  1. bztest-1.2rc2-discard.txt (5862 bytes)
  2. bztest-1.1-discard.txt (5859 bytes)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions