Open ajstarks opened 9 years ago
Looks like a lot of nice improvements. The author writes:
I will probably tidy up the crc32 optimization and submit it to Go to be part of the standard library.
I am inclined to wait until this happens. One of the nice features of gofpdf currently is that it depends only on the Go standard library.
I also like that gofpdf only depends on the Go standard library. If these new compression packages don't make it to the standard library, perhaps we could define the compression through an interface to allow different implementations (with the go stdlib as the default).
perhaps we could define the compression through an interface to allow different implementations
Excellent idea. It looks to me like the interface would be as simple as
type Compressor interface {
Compress([]byte) ([]byte, error)
Uncompress([]byte) []byte
}
A new method, SetCompressor(cmp Compressor)
, could be used to register the implementation.
I think a part of the work of @klauspost is now in Go 1.7
See: http://blog.klauspost.com/optimized-gzipzip-packages-30-50-faster/ --- a drop in replacement for Go's standard compression package.
As an experiment, I've used it on in font.go and util.go, and indeed for my application, pdfdeck, builds are a bit faster on my MacBook AIr (1.4 vs 1.3 seconds to build a image-heavy presentation).
Any interest?